line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
6
|
|
|
6
|
|
637
|
use 5.006; # our |
|
6
|
|
|
|
|
17
|
|
2
|
6
|
|
|
6
|
|
28
|
use strict; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
144
|
|
3
|
6
|
|
|
6
|
|
32
|
use warnings; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
402
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Deep::Filter::Object; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Internal plumbing for Test::Deep::Filter |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.001001'; |
12
|
|
|
|
|
|
|
|
13
|
6
|
|
|
6
|
|
2622
|
use parent 'Test::Deep::Cmp'; |
|
6
|
|
|
|
|
1607
|
|
|
6
|
|
|
|
|
31
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub init { |
22
|
9
|
|
|
9
|
1
|
52
|
my ( $self, $filter, $expected ) = @_; |
23
|
9
|
|
|
|
|
162
|
$self->{ __PACKAGE__ . '_filter' } = $filter; |
24
|
9
|
|
|
|
|
13
|
$self->{ __PACKAGE__ . '_expected' } = $expected; |
25
|
9
|
|
|
|
|
19
|
return; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
## no critic ( RequireArgUnpacking, RequireFinalReturn ) |
39
|
9
|
|
|
9
|
1
|
24
|
sub filter { $_[0]->{ __PACKAGE__ . '_filter' } } |
40
|
6
|
|
|
6
|
1
|
13
|
sub expected { $_[0]->{ __PACKAGE__ . '_expected' } } |
41
|
|
|
|
|
|
|
## use critic |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub descend { |
50
|
9
|
|
|
9
|
1
|
7454
|
my ( $self, $got ) = @_; |
51
|
9
|
|
|
|
|
14
|
delete $self->{ __PACKAGE__ . '_error' }; |
52
|
9
|
|
|
|
|
10
|
my $return; |
53
|
|
|
|
|
|
|
{ |
54
|
9
|
|
|
|
|
9
|
local $@ = undef; |
|
9
|
|
|
|
|
11
|
|
55
|
9
|
|
|
|
|
13
|
$return = eval { local $_ = $got; $self->filter->($got) }; |
|
9
|
|
|
|
|
10
|
|
|
9
|
|
|
|
|
19
|
|
56
|
9
|
100
|
66
|
|
|
118
|
if ( defined $@ and length $@ ) { |
57
|
3
|
|
|
|
|
6
|
$self->{ __PACKAGE__ . '_error' } = $@; |
58
|
3
|
|
|
|
|
6
|
return 0; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
6
|
|
|
|
|
29
|
require Test::Deep; |
62
|
6
|
|
|
|
|
13
|
return Test::Deep::wrap( $self->expected )->descend($return); ## no critic (ProhibitCallsToUnexportedSubs) |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub diagnostics { |
72
|
3
|
|
|
3
|
1
|
522
|
my ( $self, $where, $last_exp ) = @_; |
73
|
3
|
50
|
|
|
|
15
|
return $self->{ __PACKAGE__ . '_error' } if exists $self->{ __PACKAGE__ . '_error' }; |
74
|
0
|
|
|
|
|
|
return $self->expected->diagnostics( $where, $last_exp ); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |