Deep/None.pm

filter: Statementstmt 97.2% 35 / 36 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 4 totaltotal 88.2% 45 / 51 CC 4 SCAR 5.9
CC
4
Cov
95%
descend
3.0
init
2.1
BEGIN
1.0
CRAP 1.8
« Deep/ScalarRef.pm ↑ Summary Deep/ArrayElementsOnly.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::None 1.205;
5  
6 1 ▶use Test::Deep::Cmp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 sub init
9 5 ▶{
Subroutine init: called CC=2 SCAR=7.2
Pod undocumented
10 5 my $self = shift;
11  
12 my @list = map {
13 5 eval { $_->isa('Test::Deep::None') }
14 0 ▶ ? @{ $_->{val} }
Branch: 1 branch
BranchTrueFalseTotal
eval { do { $_->isa('Test::Deep::None') } } ? : 0 7 7
15 : $_
16 } @_;
17  
18 5 $self->{val} = \@list;
19 }
20  
21 sub descend
22 5 ▶{
Subroutine descend: called CC=3 SCAR=11.0
Pod undocumented
23 5 my $self = shift;
24 5 my $got = shift;
25  
26 5 foreach my $cmp (@{$self->{val}})
27 {
28 7 ▶ return 0 if Test::Deep::eq_deeply_cache($got, $cmp);
Branch: 1 branch
BranchTrueFalseTotal
if Test::Deep::eq_deeply_cache($got, $cmp) 2 5 7
29 }
30  
31 3 return 1;
32 }
33  
34 sub renderExp
35 2 ▶{
Subroutine renderExp: called CC=1 SCAR=0.0
Pod undocumented
36 2 my $self = shift;
37  
38 2 my @expect = map {; Test::Deep::wrap($_) } @{ $self->{val} };
39 2 my $things = join(", ", map {$_->renderExp} @expect);
40  
41 2 return "None of ( $things )";
42 }
43  
44 sub diagnostics
45 1 ▶{
Subroutine diagnostics: called CC=1 SCAR=0.0
Pod undocumented
46 1 my $self = shift;
47 1 my ($where, $last) = @_;
48  
49 1 my $got = $self->renderGot($last->{got});
50 1 my $exp = $self->renderExp;
51  
52 1 my $diag = <<EOM;
53 Comparing $where with None
54 got : $got
55 expected : $exp
56 EOM
57  
58 1 $diag =~ s/\n+$/\n/;
59 1 return $diag;
60 }
61  
62 1 1;
63  
64 __END__
« Deep/ScalarRef.pm ↑ Summary Deep/ArrayElementsOnly.pm »