line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
6
|
#line 1 |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
3
|
|
|
|
|
|
|
use warnings; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Deep::Cache; |
6
|
1
|
|
|
1
|
|
617
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
404
|
|
7
|
|
|
|
|
|
|
use Test::Deep::Cache::Simple; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
6
|
|
|
6
|
0
|
11
|
{ |
11
|
|
|
|
|
|
|
my $pkg = shift; |
12
|
6
|
|
|
|
|
17
|
|
13
|
|
|
|
|
|
|
my $self = bless {}, $pkg; |
14
|
6
|
|
|
|
|
47
|
|
15
|
6
|
|
|
|
|
68
|
$self->{expects} = [Test::Deep::Cache::Simple->new]; |
16
|
|
|
|
|
|
|
$self->{normal} = [Test::Deep::Cache::Simple->new]; |
17
|
6
|
|
|
|
|
22
|
|
18
|
|
|
|
|
|
|
$self->local; |
19
|
6
|
|
|
|
|
19
|
|
20
|
|
|
|
|
|
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub add |
24
|
36
|
|
|
36
|
0
|
45
|
{ |
25
|
|
|
|
|
|
|
my $self = shift; |
26
|
36
|
|
|
|
|
78
|
|
27
|
|
|
|
|
|
|
my $type = $self->type; |
28
|
36
|
|
|
|
|
139
|
|
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
|
36
|
|
|
36
|
0
|
43
|
|
36
|
|
|
|
|
|
|
my $self = shift; |
37
|
36
|
|
|
|
|
79
|
|
38
|
|
|
|
|
|
|
my $type = $self->type; |
39
|
36
|
|
|
|
|
46
|
|
|
36
|
|
|
|
|
95
|
|
40
|
|
|
|
|
|
|
foreach my $cache (@{$self->{$type}}) |
41
|
72
|
50
|
|
|
|
233
|
{ |
42
|
|
|
|
|
|
|
return 1 if $cache->cmp(@_); |
43
|
|
|
|
|
|
|
} |
44
|
36
|
|
|
|
|
160
|
|
45
|
|
|
|
|
|
|
return 0 |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub local |
49
|
6
|
|
|
6
|
0
|
9
|
{ |
50
|
|
|
|
|
|
|
my $self = shift; |
51
|
6
|
|
|
|
|
13
|
|
52
|
|
|
|
|
|
|
foreach my $type (qw( expects normal )) |
53
|
12
|
|
|
|
|
13
|
{ |
|
12
|
|
|
|
|
42
|
|
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
|
72
|
50
|
|
72
|
0
|
234
|
{ |
76
|
|
|
|
|
|
|
return $Test::Deep::Expects ? "expects" : "normal"; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |