Devel::Cover::Truth_Table(3pm) User Contributed Perl Documentation Devel::Cover::Truth_Table(3pm)
Devel::Cover::Truth_Table - Create and manipulate truth tables for coverage objects.
# $a || $b
my $or_tt = Devel::Cover::Truth_Table->new_primitive('or_3', 0, 1, 1);
# $c && $d
my $and_tt = Devel::Cover::Truth_Table->new_primitive('and_3', 1, 0, 1);
# merge contents of $and_tt into right column of $or_tt, to create
# $a || ($c && $d)
# get a (sorted) textual representation
my @text = $or_tt->sort->text;
" foreach @text;
A B C |exp|hit
0 0 X | 0 |---
0 1 0 | 0 |---
0 1 1 | 1 |+++
1 X X | 1 |+++
This module provides methods for creating and merging conditional primitives ("$a && $b", "$c || $d", etc.) into more complex composite
Create a new truth table based on one of the built-in primitives, which are the subclasses of Devel::Cover::DB::Condition. $op is one of
"and" or "&&" with three conditional paths.
"or" or "||" with three conditional paths.
"or" or "||" with two conditional paths. (i.e., when the right hand side of the expression is a constant)
"xor" with four conditional paths.
@coverage is a list booleans identifying which of the possible paths have been covered.
Sorts a truth table (in place) and returns the sorted object.
Format a truth table to an array of strings for printing.
Format a truth table in HTML.
Determines the proportion of possible conditions that have coverage.
Merge entries from $sub_table into right column of table.
Merge entries from $sub_table into left column of table.
None that I'm aware of...
Copyright 2002 Michael Carman <firstname.lastname@example.org>
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
perl v5.14.2 2012-06-16 Devel::Cover::Truth_Table(3pm)