line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Compare::Scalar; |
2
|
100
|
|
|
100
|
|
1097
|
use strict; |
|
100
|
|
|
|
|
177
|
|
|
100
|
|
|
|
|
2552
|
|
3
|
100
|
|
|
100
|
|
493
|
use warnings; |
|
100
|
|
|
|
|
223
|
|
|
100
|
|
|
|
|
2635
|
|
4
|
|
|
|
|
|
|
|
5
|
100
|
|
|
100
|
|
518
|
use Test::Stream::Compare; |
|
100
|
|
|
|
|
205
|
|
|
100
|
|
|
|
|
673
|
|
6
|
|
|
|
|
|
|
use Test::Stream::HashBase( |
7
|
100
|
|
|
|
|
746
|
base => 'Test::Stream::Compare', |
8
|
|
|
|
|
|
|
accessors => [qw/item/], |
9
|
100
|
|
|
100
|
|
524
|
); |
|
100
|
|
|
|
|
199
|
|
10
|
|
|
|
|
|
|
|
11
|
100
|
|
|
100
|
|
568
|
use Carp qw/croak confess/; |
|
100
|
|
|
|
|
190
|
|
|
100
|
|
|
|
|
5478
|
|
12
|
100
|
|
|
100
|
|
529
|
use Scalar::Util qw/reftype blessed/; |
|
100
|
|
|
|
|
281
|
|
|
100
|
|
|
|
|
30985
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub init { |
15
|
11
|
|
|
11
|
0
|
20
|
my $self = shift; |
16
|
|
|
|
|
|
|
croak "'item' is a required attribute" |
17
|
11
|
100
|
|
|
|
242
|
unless $self->{+ITEM}; |
18
|
|
|
|
|
|
|
|
19
|
10
|
|
|
|
|
40
|
$self->SUPER::init(); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
1
|
11
|
sub name { '' } |
23
|
1
|
|
|
1
|
1
|
4
|
sub operator { '${...}' } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub verify { |
26
|
8
|
|
|
8
|
1
|
21
|
my $self = shift; |
27
|
8
|
|
|
|
|
31
|
my %params = @_; |
28
|
8
|
|
|
|
|
18
|
my ($got, $exists) = @params{qw/got exists/}; |
29
|
|
|
|
|
|
|
|
30
|
8
|
100
|
|
|
|
27
|
return 0 unless $exists; |
31
|
7
|
100
|
|
|
|
20
|
return 0 unless defined $got; |
32
|
6
|
100
|
|
|
|
25
|
return 0 unless ref($got); |
33
|
5
|
100
|
|
|
|
28
|
return 0 unless reftype($got) eq 'SCALAR'; |
34
|
4
|
|
|
|
|
16
|
return 1; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub deltas { |
38
|
5
|
|
|
5
|
1
|
10
|
my $self = shift; |
39
|
5
|
|
|
|
|
18
|
my %params = @_; |
40
|
5
|
|
|
|
|
13
|
my ($got, $convert, $seen) = @params{qw/got convert seen/}; |
41
|
|
|
|
|
|
|
|
42
|
5
|
|
|
|
|
10
|
my $item = $self->{+ITEM}; |
43
|
5
|
|
|
|
|
19
|
my $check = $convert->($item); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
return ( |
46
|
5
|
|
|
|
|
32
|
$check->run( |
47
|
|
|
|
|
|
|
id => ['SCALAR' => '$*'], |
48
|
|
|
|
|
|
|
got => $$got, |
49
|
|
|
|
|
|
|
convert => $convert, |
50
|
|
|
|
|
|
|
seen => $seen, |
51
|
|
|
|
|
|
|
exists => 1, |
52
|
|
|
|
|
|
|
), |
53
|
|
|
|
|
|
|
); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
__END__ |