Deep/ArrayElementsOnly.pm

filter: Statementstmt 100% 30 / 30 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 4 totaltotal 91.1% 41 / 45 CC 4 SCAR 5.9
CC
4
Cov
100%
descend
3.0
render_stack
2.0
BEGIN
1.0
CRAP 1.8
« Deep/None.pm ↑ Summary Deep/Array.pm »
1 18 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 18 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package Test::Deep::ArrayElementsOnly 1.205;
5  
6 18 ▶use Test::Deep::Ref;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 sub init
9 118 ▶{
Subroutine init: called CC=1 SCAR=0.0
Pod undocumented
10 118 my $self = shift;
11  
12 118 my $val = shift;
13  
14 118 $self->{val} = $val;
15 }
16  
17 sub descend
18 118 ▶{
Subroutine descend: called CC=3 SCAR=11.0
Pod undocumented
19 118 my $self = shift;
20 118 my $got = shift;
21  
22 118 my $exp = $self->{val};
23  
24 118 my $data = $self->data;
25  
26 118 for my $i (0..$#{$exp})
27 {
28 199 $data->{index} = $i;
29  
30 199 my $got_elem = $got->[$i];
31 199 my $exp_elem = $exp->[$i];
32  
33 199 ▶ return 0 unless Test::Deep::descend($got_elem, $exp_elem)
Branch: 1 branch
BranchTrueFalseTotal
unless Test::Deep::descend($got_elem, $exp_elem) 39 159 198
34 }
35  
36 78 return 1;
37 }
38  
39 sub render_stack
40 31 ▶{
Subroutine render_stack: called CC=2 SCAR=6.9
Pod undocumented
41 31 my $self = shift;
42 31 my ($var, $data) = @_;
43 31 ▶ $var .= "->" unless $Test::Deep::Stack->incArrow;
Branch: 1 branch
BranchTrueFalseTotal
unless $Test::Deep::Stack->incArrow 26 5 31
44 31 $var .= "[$data->{index}]";
45  
46 31 return $var;
47 }
48  
49 sub reset_arrow
50 31 ▶{
Subroutine reset_arrow: called CC=1 SCAR=0.0
Pod undocumented
51 31 return 0;
52 }
53  
54 18 1;
55  
56 __END__
« Deep/None.pm ↑ Summary Deep/Array.pm »