line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
13
|
#line 1 |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
73
|
|
2
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
77
|
|
3
|
|
|
|
|
|
|
use warnings; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Deep::Cache; |
6
|
2
|
|
|
2
|
|
1836
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
669
|
|
7
|
|
|
|
|
|
|
use Test::Deep::Cache::Simple; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
6
|
|
|
6
|
0
|
10
|
{ |
11
|
|
|
|
|
|
|
my $pkg = shift; |
12
|
6
|
|
|
|
|
17
|
|
13
|
|
|
|
|
|
|
my $self = bless {}, $pkg; |
14
|
6
|
|
|
|
|
40
|
|
15
|
6
|
|
|
|
|
20
|
$self->{expects} = [Test::Deep::Cache::Simple->new]; |
16
|
|
|
|
|
|
|
$self->{normal} = [Test::Deep::Cache::Simple->new]; |
17
|
6
|
|
|
|
|
19
|
|
18
|
|
|
|
|
|
|
$self->local; |
19
|
6
|
|
|
|
|
20
|
|
20
|
|
|
|
|
|
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub add |
24
|
60
|
|
|
60
|
0
|
77
|
{ |
25
|
|
|
|
|
|
|
my $self = shift; |
26
|
60
|
|
|
|
|
101
|
|
27
|
|
|
|
|
|
|
my $type = $self->type; |
28
|
60
|
|
|
|
|
208
|
|
29
|
|
|
|
|
|
|
$self->{$type}->[-1]->add(@_); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub cmp |
33
|
|
|
|
|
|
|
{ |
34
|
|
|
|
|
|
|
# go through all the caches to see if we know this one |
35
|
60
|
|
|
60
|
0
|
76
|
|
36
|
|
|
|
|
|
|
my $self = shift; |
37
|
60
|
|
|
|
|
122
|
|
38
|
|
|
|
|
|
|
my $type = $self->type; |
39
|
60
|
|
|
|
|
67
|
|
|
60
|
|
|
|
|
139
|
|
40
|
|
|
|
|
|
|
foreach my $cache (@{$self->{$type}}) |
41
|
120
|
50
|
|
|
|
309
|
{ |
42
|
|
|
|
|
|
|
return 1 if $cache->cmp(@_); |
43
|
|
|
|
|
|
|
} |
44
|
60
|
|
|
|
|
188
|
|
45
|
|
|
|
|
|
|
return 0 |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub local |
49
|
6
|
|
|
6
|
0
|
12
|
{ |
50
|
|
|
|
|
|
|
my $self = shift; |
51
|
6
|
|
|
|
|
13
|
|
52
|
|
|
|
|
|
|
foreach my $type (qw( expects normal )) |
53
|
12
|
|
|
|
|
17
|
{ |
|
12
|
|
|
|
|
41
|
|
54
|
|
|
|
|
|
|
push(@{$self->{$type}}, Test::Deep::Cache::Simple->new); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub finish |
59
|
0
|
|
|
0
|
0
|
0
|
{ |
60
|
|
|
|
|
|
|
my $self = shift; |
61
|
0
|
|
|
|
|
0
|
|
62
|
|
|
|
|
|
|
my $keep = shift; |
63
|
0
|
|
|
|
|
0
|
|
64
|
|
|
|
|
|
|
foreach my $type (qw( expects normal )) |
65
|
0
|
|
|
|
|
0
|
{ |
66
|
|
|
|
|
|
|
my $caches = $self->{$type}; |
67
|
0
|
|
|
|
|
0
|
|
68
|
|
|
|
|
|
|
my $last = pop @$caches; |
69
|
0
|
0
|
|
|
|
0
|
|
70
|
|
|
|
|
|
|
$caches->[-1]->absorb($last) if $keep; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub type |
75
|
120
|
50
|
|
120
|
0
|
252
|
{ |
76
|
|
|
|
|
|
|
return $Test::Deep::Expects ? "expects" : "normal"; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |