File Coverage

blib/lib/Test/Deep/RegexpRef.pm
Criterion Covered Total %
statement 21 25 84.0
branch 2 8 25.0
condition n/a
subroutine 6 7 85.7
pod 0 3 0.0
total 29 43 67.4


line stmt bran cond sub pod time code
1 1     1   7 use strict;
  1         2  
  1         45  
2 1     1   6 use warnings;
  1         2  
  1         154  
3              
4             package Test::Deep::RegexpRef 1.205;
5              
6 1     1   547 use Test::Deep::Ref;
  1         4  
  1         10  
7 1     1   7 use Test::Deep::RegexpVersion;
  1         2  
  1         268  
8              
9             sub init
10             {
11 2     2 0 3 my $self = shift;
12              
13 2         3 my $val = shift;
14              
15 2         55 $self->{val} = $val;
16             }
17              
18             sub descend
19             {
20 2     2 0 4 my $self = shift;
21              
22 2         3 my $got = shift;
23              
24 2         5 my $exp = $self->{val};
25              
26 2 50       6 if ($Test::Deep::RegexpVersion::OldStyle) {
27 0 0       0 return 0 unless $self->test_class($got, "Regexp");
28 0 0       0 return 0 unless $self->test_reftype($got, "SCALAR");
29             } else {
30 2 50       10 return 0 unless $self->test_reftype($got, "REGEXP");
31             }
32              
33 2         7 return Test::Deep::descend($got, Test::Deep::regexprefonly($exp));
34             }
35              
36             sub renderGot
37             {
38 0     0 0   my $self = shift;
39              
40 0           return shift()."";
41             }
42              
43             1;
44              
45             __END__