line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Compare::Scalar; |
2
|
100
|
|
|
100
|
|
653
|
use strict; |
|
100
|
|
|
|
|
109
|
|
|
100
|
|
|
|
|
2231
|
|
3
|
100
|
|
|
100
|
|
289
|
use warnings; |
|
100
|
|
|
|
|
109
|
|
|
100
|
|
|
|
|
1937
|
|
4
|
|
|
|
|
|
|
|
5
|
100
|
|
|
100
|
|
276
|
use base 'Test::Stream::Compare'; |
|
100
|
|
|
|
|
117
|
|
|
100
|
|
|
|
|
6154
|
|
6
|
100
|
|
|
100
|
|
376
|
use Test::Stream::HashBase accessors => [qw/item/]; |
|
100
|
|
|
|
|
103
|
|
|
100
|
|
|
|
|
546
|
|
7
|
|
|
|
|
|
|
|
8
|
100
|
|
|
100
|
|
426
|
use Carp qw/croak confess/; |
|
100
|
|
|
|
|
127
|
|
|
100
|
|
|
|
|
4098
|
|
9
|
100
|
|
|
100
|
|
350
|
use Scalar::Util qw/reftype blessed/; |
|
100
|
|
|
|
|
118
|
|
|
100
|
|
|
|
|
20986
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub init { |
12
|
11
|
|
|
11
|
0
|
12
|
my $self = shift; |
13
|
|
|
|
|
|
|
croak "'item' is a required attribute" |
14
|
11
|
100
|
|
|
|
161
|
unless $self->{+ITEM}; |
15
|
|
|
|
|
|
|
|
16
|
10
|
|
|
|
|
28
|
$self->SUPER::init(); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
1
|
57
|
sub name { '' } |
20
|
1
|
|
|
1
|
1
|
3
|
sub operator { '${...}' } |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub verify { |
23
|
8
|
|
|
8
|
1
|
8
|
my $self = shift; |
24
|
8
|
|
|
|
|
16
|
my %params = @_; |
25
|
8
|
|
|
|
|
14
|
my ($got, $exists) = @params{qw/got exists/}; |
26
|
|
|
|
|
|
|
|
27
|
8
|
100
|
|
|
|
18
|
return 0 unless $exists; |
28
|
7
|
100
|
|
|
|
17
|
return 0 unless defined $got; |
29
|
6
|
100
|
|
|
|
15
|
return 0 unless ref($got); |
30
|
5
|
100
|
|
|
|
18
|
return 0 unless reftype($got) eq 'SCALAR'; |
31
|
4
|
|
|
|
|
14
|
return 1; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub deltas { |
35
|
5
|
|
|
5
|
1
|
6
|
my $self = shift; |
36
|
5
|
|
|
|
|
16
|
my %params = @_; |
37
|
5
|
|
|
|
|
8
|
my ($got, $convert, $seen) = @params{qw/got convert seen/}; |
38
|
|
|
|
|
|
|
|
39
|
5
|
|
|
|
|
5
|
my $item = $self->{+ITEM}; |
40
|
5
|
|
|
|
|
10
|
my $check = $convert->($item); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
return ( |
43
|
5
|
|
|
|
|
21
|
$check->run( |
44
|
|
|
|
|
|
|
id => ['SCALAR' => '$*'], |
45
|
|
|
|
|
|
|
got => $$got, |
46
|
|
|
|
|
|
|
convert => $convert, |
47
|
|
|
|
|
|
|
seen => $seen, |
48
|
|
|
|
|
|
|
exists => 1, |
49
|
|
|
|
|
|
|
), |
50
|
|
|
|
|
|
|
); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
__END__ |