Deep/Boolean.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 4 / 4 Conditioncond 100% 4 / 4 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 5 totaltotal 89.1% 41 / 46 CC 4 SCAR 4.4
CC
4
Cov
100%
init
2.0
descend
2.0
renderGot
2.0
CRAP 1.5
« Deep/RegexpMatches.pm ↑ Summary Deep/Code.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Test::Deep::Boolean 1.205;
5  
6 1 ▶use Test::Deep::Cmp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 sub init
9 18 ▶{
Subroutine init: called CC=2 SCAR=6.9
Pod undocumented
10 18 my $self = shift;
11  
12 18 ▶ $self->{val} = shift() ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
shift() ? : 8 10 18
13 }
14  
15 sub descend
16 18 ▶{
Subroutine descend: called CC=2 SCAR=6.9
Pod undocumented
17 18 my $self = shift;
18 18 my $got = shift;
19  
20 18 ▶ return !( $got xor $self->{val} );
Condition100%4/4
$got ^^ $self->{"val"}
l&&rl&&!r!l&&r!l&&!r
4446
MC/DC100%2/2
$got ^^ $self->{"val"}
$got $self->{"val"}
Truth table100%4/4
A ^^ B
A= $gotB= $self->{"val"}
ABresult
110
101
011
000
21 }
22  
23 sub diag_message
24 8 ▶{
Subroutine diag_message: called CC=1 SCAR=0.0
Pod undocumented
25 8 my $self = shift;
26 8 my $where = shift;
27 8 return "Comparing $where as a boolean";
28 }
29  
30 sub renderExp
31 8 ▶{
Subroutine renderExp: called CC=1 SCAR=0.0
Pod undocumented
32 8 my $self = shift;
33  
34 8 $self->renderGot($self->{val});
35 }
36  
37 sub renderGot
38 16 ▶{
Subroutine renderGot: called CC=2 SCAR=6.9
Pod undocumented
39 16 my $self = shift;
40  
41 16 my $val = shift;
42  
43 16 ▶ return ($val ? "true" : "false")." (".Test::Deep::render_val($val).")";
Branch: 1 branch
BranchTrueFalseTotal
$val ? : 8 8 16
44 }
45  
46 1 1;
47  
48 __END__
« Deep/RegexpMatches.pm ↑ Summary Deep/Code.pm »