line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Compare::Scalar; |
2
|
100
|
|
|
100
|
|
1065
|
use strict; |
|
100
|
|
|
|
|
186
|
|
|
100
|
|
|
|
|
2611
|
|
3
|
100
|
|
|
100
|
|
512
|
use warnings; |
|
100
|
|
|
|
|
194
|
|
|
100
|
|
|
|
|
2633
|
|
4
|
|
|
|
|
|
|
|
5
|
100
|
|
|
100
|
|
519
|
use Test::Stream::Compare; |
|
100
|
|
|
|
|
199
|
|
|
100
|
|
|
|
|
664
|
|
6
|
|
|
|
|
|
|
use Test::Stream::HashBase( |
7
|
100
|
|
|
|
|
818
|
base => 'Test::Stream::Compare', |
8
|
|
|
|
|
|
|
accessors => [qw/item/], |
9
|
100
|
|
|
100
|
|
592
|
); |
|
100
|
|
|
|
|
861
|
|
10
|
|
|
|
|
|
|
|
11
|
100
|
|
|
100
|
|
566
|
use Carp qw/croak confess/; |
|
100
|
|
|
|
|
200
|
|
|
100
|
|
|
|
|
5325
|
|
12
|
100
|
|
|
100
|
|
518
|
use Scalar::Util qw/reftype blessed/; |
|
100
|
|
|
|
|
197
|
|
|
100
|
|
|
|
|
31147
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub init { |
15
|
11
|
|
|
11
|
0
|
19
|
my $self = shift; |
16
|
|
|
|
|
|
|
croak "'item' is a required attribute" |
17
|
11
|
100
|
|
|
|
232
|
unless $self->{+ITEM}; |
18
|
|
|
|
|
|
|
|
19
|
10
|
|
|
|
|
54
|
$self->SUPER::init(); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
1
|
1
|
12
|
sub name { '' } |
23
|
1
|
|
|
1
|
1
|
5
|
sub operator { '${...}' } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub verify { |
26
|
8
|
|
|
8
|
1
|
17
|
my $self = shift; |
27
|
8
|
|
|
|
|
28
|
my %params = @_; |
28
|
8
|
|
|
|
|
23
|
my ($got, $exists) = @params{qw/got exists/}; |
29
|
|
|
|
|
|
|
|
30
|
8
|
100
|
|
|
|
28
|
return 0 unless $exists; |
31
|
7
|
100
|
|
|
|
24
|
return 0 unless defined $got; |
32
|
6
|
100
|
|
|
|
22
|
return 0 unless ref($got); |
33
|
5
|
100
|
|
|
|
27
|
return 0 unless reftype($got) eq 'SCALAR'; |
34
|
4
|
|
|
|
|
17
|
return 1; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub deltas { |
38
|
5
|
|
|
5
|
1
|
9
|
my $self = shift; |
39
|
5
|
|
|
|
|
17
|
my %params = @_; |
40
|
5
|
|
|
|
|
14
|
my ($got, $convert, $seen) = @params{qw/got convert seen/}; |
41
|
|
|
|
|
|
|
|
42
|
5
|
|
|
|
|
13
|
my $item = $self->{+ITEM}; |
43
|
5
|
|
|
|
|
18
|
my $check = $convert->($item); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
return ( |
46
|
5
|
|
|
|
|
33
|
$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__ |