Deep/Shallow.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 8 / 8 Conditioncond 85.7% 12 / 14 MC/DCmcdc 100% 8 / 8 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 93.8% 61 / 65 CC 9 SCAR 18.2
CC
9
Cov
96%
descend
9.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.2
« Deep/Set.pm ↑ Summary Deep/RegexpRef.pm »
1 30 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 30 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Test::Deep::Shallow 1.205;
5  
6 30 ▶use Test::Deep::Cmp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 30 ▶use Scalar::Util qw( refaddr );
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 sub init
11 805 ▶{
Subroutine init: called CC=1 SCAR=0.0
Pod undocumented
12 805 my $self = shift;
13  
14 805 my $val = shift;
15 805 $self->{val} = $val;
16 }
17  
18 sub descend
19 794 ▶{
Subroutine descend: called CC=9 SCAR=22.0
Pod undocumented
20 794 my $self = shift;
21  
22 794 my $got = shift;
23 794 my $exp = $self->{val};
24  
25 794 my $ok;
26  
27 794 ▶ if (!defined $got and !defined $exp)
Branch: 4 branches
BranchTrueFalseTotal
if (not defined $got || defined $exp) { } 148 646 794
elsif (defined $got xor defined $exp) { } 67 579 646
elsif (ref $got and ref $exp) { } 4 575 579
elsif (ref $got xor ref $exp) { } 36 539 575
Condition100%3/3
defined $got || defined $exp
l!l&&r!l&&!r
59056148
MC/DC100%2/2
defined $got || defined $exp
defined $got defined $exp
Truth table100%3/3
A || B
A= defined $gotB= defined $exp
ABresult
1X1
011
000
28 {
29 148 $ok = 1;
30 }
31 ▶ elsif (defined $got xor defined $exp)
Condition75%3/4
defined $got xor defined $exp
l&&rl&&!r!l&&r!l&&!r
57911560
MC/DC100%2/2
defined $got xor defined $exp
defined $got defined $exp
Truth table75%3/4
A xor B
A= defined $gotB= defined $exp
ABresult
110
101
011
000
32 {
33 67 $ok = 0;
34 }
35 ▶ elsif (ref $got and ref $exp)
Condition100%3/3
ref $got and ref $exp
!ll&&!rl&&r
541344
MC/DC100%2/2
ref $got and ref $exp
ref $got ref $exp
Truth table100%3/3
A and B
A= ref $gotB= ref $exp
ABresult
0X0
100
111
36 {
37 4 $ok = refaddr($got) == refaddr($exp);
38 }
39 ▶ elsif (ref $got xor ref $exp)
Condition75%3/4
ref $got xor ref $exp
l&&rl&&!r!l&&r!l&&!r
0342539
MC/DC100%2/2
ref $got xor ref $exp
ref $got ref $exp
Truth table75%3/4
A xor B
A= ref $gotB= ref $exp
ABresult
110
101
011
000
40 {
41 36 $ok = 0;
42 }
43 else
44 {
45 539 $ok = $got eq $exp;
46 }
47  
48 794 return $ok;
49 }
50  
51 30 1;
52  
53 __END__
« Deep/Set.pm ↑ Summary Deep/RegexpRef.pm »