line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Compare::Custom; |
2
|
100
|
|
|
100
|
|
1036
|
use strict; |
|
100
|
|
|
|
|
191
|
|
|
100
|
|
|
|
|
2542
|
|
3
|
100
|
|
|
100
|
|
498
|
use warnings; |
|
100
|
|
|
|
|
191
|
|
|
100
|
|
|
|
|
2541
|
|
4
|
|
|
|
|
|
|
|
5
|
100
|
|
|
100
|
|
522
|
use Test::Stream::Compare; |
|
100
|
|
|
|
|
194
|
|
|
100
|
|
|
|
|
668
|
|
6
|
|
|
|
|
|
|
use Test::Stream::HashBase( |
7
|
100
|
|
|
|
|
853
|
base => 'Test::Stream::Compare', |
8
|
|
|
|
|
|
|
accessors => [qw/code name operator/], |
9
|
100
|
|
|
100
|
|
530
|
); |
|
100
|
|
|
|
|
183
|
|
10
|
|
|
|
|
|
|
|
11
|
100
|
|
|
100
|
|
555
|
use Carp qw/croak/; |
|
100
|
|
|
|
|
185
|
|
|
100
|
|
|
|
|
21687
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub init { |
14
|
644
|
|
|
644
|
0
|
973
|
my $self = shift; |
15
|
|
|
|
|
|
|
|
16
|
644
|
100
|
|
|
|
2299
|
croak "'code' is required" unless $self->{+CODE}; |
17
|
|
|
|
|
|
|
|
18
|
643
|
|
100
|
|
|
1776
|
$self->{+OPERATOR} ||= 'CODE(...)'; |
19
|
643
|
|
100
|
|
|
1557
|
$self->{+NAME} ||= ''; |
20
|
|
|
|
|
|
|
|
21
|
643
|
|
|
|
|
2387
|
$self->SUPER::init(); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub verify { |
25
|
304
|
|
|
304
|
1
|
416
|
my $self = shift; |
26
|
304
|
|
|
|
|
895
|
my %params = @_; |
27
|
304
|
|
|
|
|
589
|
my ($got, $exists) = @params{qw/got exists/}; |
28
|
|
|
|
|
|
|
|
29
|
304
|
|
|
|
|
465
|
my $code = $self->{+CODE}; |
30
|
|
|
|
|
|
|
|
31
|
304
|
|
|
|
|
461
|
local $_ = $got; |
32
|
|
|
|
|
|
|
my $ok = $code->( |
33
|
|
|
|
|
|
|
got => $got, |
34
|
|
|
|
|
|
|
exists => $exists, |
35
|
|
|
|
|
|
|
operator => $self->{+OPERATOR}, |
36
|
304
|
|
|
|
|
1025
|
name => $self->{+NAME} |
37
|
|
|
|
|
|
|
); |
38
|
|
|
|
|
|
|
|
39
|
304
|
|
|
|
|
2035
|
return $ok; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |