line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Compare::Custom; |
2
|
100
|
|
|
100
|
|
1052
|
use strict; |
|
100
|
|
|
|
|
205
|
|
|
100
|
|
|
|
|
2598
|
|
3
|
100
|
|
|
100
|
|
514
|
use warnings; |
|
100
|
|
|
|
|
195
|
|
|
100
|
|
|
|
|
2571
|
|
4
|
|
|
|
|
|
|
|
5
|
100
|
|
|
100
|
|
512
|
use Test::Stream::Compare; |
|
100
|
|
|
|
|
193
|
|
|
100
|
|
|
|
|
737
|
|
6
|
|
|
|
|
|
|
use Test::Stream::HashBase( |
7
|
100
|
|
|
|
|
791
|
base => 'Test::Stream::Compare', |
8
|
|
|
|
|
|
|
accessors => [qw/code name operator/], |
9
|
100
|
|
|
100
|
|
534
|
); |
|
100
|
|
|
|
|
176
|
|
10
|
|
|
|
|
|
|
|
11
|
100
|
|
|
100
|
|
539
|
use Carp qw/croak/; |
|
100
|
|
|
|
|
191
|
|
|
100
|
|
|
|
|
21755
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub init { |
14
|
644
|
|
|
644
|
0
|
1052
|
my $self = shift; |
15
|
|
|
|
|
|
|
|
16
|
644
|
100
|
|
|
|
2260
|
croak "'code' is required" unless $self->{+CODE}; |
17
|
|
|
|
|
|
|
|
18
|
643
|
|
100
|
|
|
1612
|
$self->{+OPERATOR} ||= 'CODE(...)'; |
19
|
643
|
|
100
|
|
|
1579
|
$self->{+NAME} ||= ''; |
20
|
|
|
|
|
|
|
|
21
|
643
|
|
|
|
|
2220
|
$self->SUPER::init(); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub verify { |
25
|
304
|
|
|
304
|
1
|
459
|
my $self = shift; |
26
|
304
|
|
|
|
|
907
|
my %params = @_; |
27
|
304
|
|
|
|
|
635
|
my ($got, $exists) = @params{qw/got exists/}; |
28
|
|
|
|
|
|
|
|
29
|
304
|
|
|
|
|
508
|
my $code = $self->{+CODE}; |
30
|
|
|
|
|
|
|
|
31
|
304
|
|
|
|
|
480
|
local $_ = $got; |
32
|
|
|
|
|
|
|
my $ok = $code->( |
33
|
|
|
|
|
|
|
got => $got, |
34
|
|
|
|
|
|
|
exists => $exists, |
35
|
|
|
|
|
|
|
operator => $self->{+OPERATOR}, |
36
|
304
|
|
|
|
|
1035
|
name => $self->{+NAME} |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
304
|
|
|
|
|
2081
|
return $ok; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |