line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
6
|
|
|
6
|
|
1150
|
use 5.006; # our |
|
6
|
|
|
|
|
21
|
|
2
|
6
|
|
|
6
|
|
29
|
use strict; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
160
|
|
3
|
6
|
|
|
6
|
|
38
|
use warnings; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
440
|
|
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.001000'; |
12
|
|
|
|
|
|
|
|
13
|
6
|
|
|
6
|
|
3255
|
use parent 'Test::Deep::Cmp'; |
|
6
|
|
|
|
|
1816
|
|
|
6
|
|
|
|
|
33
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub init { |
22
|
9
|
|
|
9
|
1
|
56
|
my ( $self, $filter, $expected ) = @_; |
23
|
9
|
|
|
|
|
166
|
$self->{ __PACKAGE__ . '_filter' } = $filter; |
24
|
9
|
|
|
|
|
18
|
$self->{ __PACKAGE__ . '_expected' } = $expected; |
25
|
9
|
|
|
|
|
21
|
return; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
## no critic ( RequireArgUnpacking, RequireFinalReturn ) |
39
|
9
|
|
|
9
|
1
|
30
|
sub filter { $_[0]->{ __PACKAGE__ . '_filter' } } |
40
|
6
|
|
|
6
|
1
|
18
|
sub expected { $_[0]->{ __PACKAGE__ . '_expected' } } |
41
|
|
|
|
|
|
|
## use critic |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub descend { |
50
|
9
|
|
|
9
|
1
|
8946
|
my ( $self, $got ) = @_; |
51
|
9
|
|
|
|
|
19
|
delete $self->{ __PACKAGE__ . '_error' }; |
52
|
9
|
|
|
|
|
12
|
my $return; |
53
|
|
|
|
|
|
|
{ |
54
|
9
|
|
|
|
|
10
|
local $@ = undef; |
|
9
|
|
|
|
|
14
|
|
55
|
9
|
|
|
|
|
16
|
$return = eval { local $_ = $got; $self->filter->($got) }; |
|
9
|
|
|
|
|
16
|
|
|
9
|
|
|
|
|
21
|
|
56
|
9
|
100
|
66
|
|
|
136
|
if ( defined $@ and length $@ ) { |
57
|
3
|
|
|
|
|
6
|
$self->{ __PACKAGE__ . '_error' } = $@; |
58
|
3
|
|
|
|
|
8
|
return 0; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
} |
61
|
6
|
|
|
|
|
32
|
require Test::Deep; |
62
|
6
|
|
|
|
|
20
|
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
|
591
|
my ( $self, $where, $last_exp ) = @_; |
73
|
3
|
50
|
|
|
|
16
|
return $self->{ __PACKAGE__ . '_error' } if exists $self->{ __PACKAGE__ . '_error' }; |
74
|
0
|
|
|
|
|
|
return $self->expected->diagnostics( $where, $last_exp ); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
1; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |