line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Compare::Custom; |
2
|
100
|
|
|
100
|
|
663
|
use strict; |
|
100
|
|
|
|
|
209
|
|
|
100
|
|
|
|
|
2353
|
|
3
|
100
|
|
|
100
|
|
305
|
use warnings; |
|
100
|
|
|
|
|
114
|
|
|
100
|
|
|
|
|
2010
|
|
4
|
|
|
|
|
|
|
|
5
|
100
|
|
|
100
|
|
299
|
use base 'Test::Stream::Compare'; |
|
100
|
|
|
|
|
105
|
|
|
100
|
|
|
|
|
6174
|
|
6
|
100
|
|
|
100
|
|
374
|
use Test::Stream::HashBase accessors => [qw/code name operator/]; |
|
100
|
|
|
|
|
121
|
|
|
100
|
|
|
|
|
568
|
|
7
|
|
|
|
|
|
|
|
8
|
100
|
|
|
100
|
|
454
|
use Carp qw/croak/; |
|
100
|
|
|
|
|
120
|
|
|
100
|
|
|
|
|
14861
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub init { |
11
|
644
|
|
|
644
|
0
|
593
|
my $self = shift; |
12
|
|
|
|
|
|
|
|
13
|
644
|
100
|
|
|
|
1469
|
croak "'code' is required" unless $self->{+CODE}; |
14
|
|
|
|
|
|
|
|
15
|
643
|
|
100
|
|
|
1040
|
$self->{+OPERATOR} ||= 'CODE(...)'; |
16
|
643
|
|
100
|
|
|
941
|
$self->{+NAME} ||= ''; |
17
|
|
|
|
|
|
|
|
18
|
643
|
|
|
|
|
1400
|
$self->SUPER::init(); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub verify { |
22
|
309
|
|
|
309
|
1
|
278
|
my $self = shift; |
23
|
309
|
|
|
|
|
527
|
my %params = @_; |
24
|
309
|
|
|
|
|
366
|
my ($got, $exists) = @params{qw/got exists/}; |
25
|
|
|
|
|
|
|
|
26
|
309
|
|
|
|
|
307
|
my $code = $self->{+CODE}; |
27
|
|
|
|
|
|
|
|
28
|
309
|
|
|
|
|
292
|
local $_ = $got; |
29
|
|
|
|
|
|
|
my $ok = $code->( |
30
|
|
|
|
|
|
|
got => $got, |
31
|
|
|
|
|
|
|
exists => $exists, |
32
|
|
|
|
|
|
|
operator => $self->{+OPERATOR}, |
33
|
309
|
|
|
|
|
755
|
name => $self->{+NAME} |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
309
|
|
|
|
|
1288
|
return $ok; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |