Deep/Any.pm

filter: Statementstmt 100% 38 / 38 Branchbran 100% 4 / 4 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 4 totaltotal 93.2% 55 / 59 CC 5 SCAR 6.9
CC
5
Cov
100%
init
3.0
descend
3.0
BEGIN
1.0
CRAP 2.0
« Deep/Cache.pm ↑ Summary Deep/ArrayEach.pm »
1 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Test::Deep::Any 1.205;
5  
6 4 ▶use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use Test::Deep::Cmp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub init
10 11 ▶{
Subroutine init: called CC=3 SCAR=11.0
Pod undocumented
11 11 my $self = shift;
12  
13 my @list = map {
14 11 (Scalar::Util::blessed($_) && $_->isa('Test::Deep::Any'))
15 19 ▶ ? @{ $_->{val} }
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($_) && $_->isa('Test::Deep::Any') ? : 1 18 19
Condition100%3/3
builtin::blessed($_) and $_->isa("Test::Deep::Any")
!ll&&!rl&&r
1351
MC/DC100%2/2
builtin::blessed($_) and $_->isa("Test::Deep::Any")
builtin::blessed($_) $_->isa("Test::Deep::Any")
Truth table100%3/3
A and B
A= builtin::blessed($_)B= $_->isa("Test::Deep::Any")
ABresult
0X0
100
111
16 : $_
17 } @_;
18  
19 11 $self->{val} = \@list;
20 }
21  
22 sub descend
23 9 ▶{
Subroutine descend: called CC=3 SCAR=11.0
Pod undocumented
24 9 my $self = shift;
25 9 my $got = shift;
26  
27 9 foreach my $cmp (@{$self->{val}})
28 {
29 14 ▶ return 1 if Test::Deep::eq_deeply_cache($got, $cmp);
Branch: 1 branch
BranchTrueFalseTotal
if Test::Deep::eq_deeply_cache($got, $cmp) 5 9 14
30 }
31  
32 4 return 0;
33 }
34  
35 sub renderExp
36 4 ▶{
Subroutine renderExp: called CC=1 SCAR=0.0
Pod undocumented
37 4 my $self = shift;
38  
39 4 my @expect = map {; Test::Deep::wrap($_) } @{ $self->{val} };
40 4 my $things = join(", ", map {$_->renderExp} @expect);
41  
42 4 return "Any of ( $things )";
43 }
44  
45 sub diagnostics
46 4 ▶{
Subroutine diagnostics: called CC=1 SCAR=0.0
Pod undocumented
47 4 my $self = shift;
48 4 my ($where, $last) = @_;
49  
50 4 my $got = $self->renderGot($last->{got});
51 4 my $exp = $self->renderExp;
52  
53 4 my $diag = <<EOM;
54 Comparing $where with Any
55 got : $got
56 expected : $exp
57 EOM
58  
59 4 $diag =~ s/\n+$/\n/;
60 4 return $diag;
61 }
62  
63 4 4;
64  
65 __END__
« Deep/Cache.pm ↑ Summary Deep/ArrayEach.pm »