.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Devel::Cover::Truth_Table 3pm" .TH Devel::Cover::Truth_Table 3pm "2021-02-02" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Devel::Cover::Truth_Table \- Truth tables for coverage objects. .SH "VERSION" .IX Header "VERSION" version 1.36 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Devel::Cover::Truth_Table; \& \& # $a || $b \& my $or_tt = Devel::Cover::Truth_Table\->new_primitive(\*(Aqor_3\*(Aq, 0, 1, 1); \& \& # $c && $d \& my $and_tt = Devel::Cover::Truth_Table\->new_primitive(\*(Aqand_3\*(Aq, 1, 0, 1); \& \& # merge contents of $and_tt into right column of $or_tt, to create \& # $a || ($c && $d) \& $or_tt\->right_merge($and_tt); \& \& # get a (sorted) textual representation \& my @text = $or_tt\->sort\->text; \& print "$_\en" foreach @text; \& \& _\|_END_\|_ \& A B C |exp|hit \& \-\-\-\-\-\-\-\-\-\-\-\-\-\- \& 0 0 X | 0 |\-\-\- \& 0 1 0 | 0 |\-\-\- \& 0 1 1 | 1 |+++ \& 1 X X | 1 |+++ \& \-\-\-\-\-\-\-\-\-\-\-\-\-\- .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides methods for creating and merging conditional primitives (\f(CW\*(C`$a && $b\*(C'\fR, \f(CW\*(C`$c || $d\*(C'\fR, etc.) into more complex composite expressions. .SH "METHODS" .IX Header "METHODS" .ie n .SS "new_primitive($op, @coverage)" .el .SS "new_primitive($op, \f(CW@coverage\fP)" .IX Subsection "new_primitive($op, @coverage)" Create a new truth table based on one of the built-in primitives, which are the subclasses of Devel::Cover::DB::Condition. \f(CW$op\fR is one of the following: .IP "and_3" 4 .IX Item "and_3" \&\f(CW\*(C`and\*(C'\fR or \f(CW\*(C`&&\*(C'\fR with three conditional paths. .IP "or_3" 4 .IX Item "or_3" \&\f(CW\*(C`or\*(C'\fR or \f(CW\*(C`||\*(C'\fR with three conditional paths. .IP "or_2" 4 .IX Item "or_2" \&\f(CW\*(C`or\*(C'\fR or \f(CW\*(C`||\*(C'\fR with two conditional paths. (i.e., when the right hand side of the expression is a constant) .IP "xor_4" 4 .IX Item "xor_4" \&\f(CW\*(C`xor\*(C'\fR with four conditional paths. .PP \&\f(CW@coverage\fR is a list booleans identifying which of the possible paths have been covered. .SS "\fBsort()\fP" .IX Subsection "sort()" Sorts a truth table (in place) and returns the sorted object. .SS "\fBtext()\fP" .IX Subsection "text()" Format a truth table to an array of strings for printing. .SS "\fBhtml()\fP" .IX Subsection "html()" Format a truth table in \s-1HTML.\s0 .SS "\fBerror()\fP" .IX Subsection "error()" .SS "\fBpercentage()\fP" .IX Subsection "percentage()" Determines the proportion of possible conditions that have coverage. .SS "right_merge($sub_table)" .IX Subsection "right_merge($sub_table)" Merge entries from \f(CW$sub_table\fR into right column of table. .SS "left_merge($sub_table)" .IX Subsection "left_merge($sub_table)" Merge entries from \f(CW$sub_table\fR into left column of table. .SH "SEE ALSO" .IX Header "SEE ALSO" Devel::Cover .SH "BUGS" .IX Header "BUGS" None that I'm aware of... .SH "LICENSE" .IX Header "LICENSE" Copyright 2002 Michael Carman .PP This software is free. It is licensed under the same terms as Perl itself. The latest version should be available from: http://www.pjcj.net