line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
5
|
#line 1 |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
33
|
|
3
|
|
|
|
|
|
|
use warnings; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Test::Deep::Cache; |
6
|
1
|
|
|
1
|
|
793
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
705
|
|
7
|
|
|
|
|
|
|
use Test::Deep::Cache::Simple; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new |
10
|
6
|
|
|
6
|
0
|
10
|
{ |
11
|
|
|
|
|
|
|
my $pkg = shift; |
12
|
6
|
|
|
|
|
16
|
|
13
|
|
|
|
|
|
|
my $self = bless {}, $pkg; |
14
|
6
|
|
|
|
|
28
|
|
15
|
6
|
|
|
|
|
20
|
$self->{expects} = [Test::Deep::Cache::Simple->new]; |
16
|
|
|
|
|
|
|
$self->{normal} = [Test::Deep::Cache::Simple->new]; |
17
|
6
|
|
|
|
|
15
|
|
18
|
|
|
|
|
|
|
$self->local; |
19
|
6
|
|
|
|
|
16
|
|
20
|
|
|
|
|
|
|
return $self; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub add |
24
|
28
|
|
|
28
|
0
|
27
|
{ |
25
|
|
|
|
|
|
|
my $self = shift; |
26
|
28
|
|
|
|
|
47
|
|
27
|
|
|
|
|
|
|
my $type = $self->type; |
28
|
28
|
|
|
|
|
114
|
|
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
|
28
|
|
|
28
|
0
|
42
|
|
36
|
|
|
|
|
|
|
my $self = shift; |
37
|
28
|
|
|
|
|
45
|
|
38
|
|
|
|
|
|
|
my $type = $self->type; |
39
|
28
|
|
|
|
|
32
|
|
|
28
|
|
|
|
|
62
|
|
40
|
|
|
|
|
|
|
foreach my $cache (@{$self->{$type}}) |
41
|
68
|
50
|
|
|
|
173
|
{ |
42
|
|
|
|
|
|
|
return 1 if $cache->cmp(@_); |
43
|
|
|
|
|
|
|
} |
44
|
28
|
|
|
|
|
85
|
|
45
|
|
|
|
|
|
|
return 0 |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub local |
49
|
14
|
|
|
14
|
0
|
16
|
{ |
50
|
|
|
|
|
|
|
my $self = shift; |
51
|
14
|
|
|
|
|
21
|
|
52
|
|
|
|
|
|
|
foreach my $type (qw( expects normal )) |
53
|
28
|
|
|
|
|
30
|
{ |
|
28
|
|
|
|
|
83
|
|
54
|
|
|
|
|
|
|
push(@{$self->{$type}}, Test::Deep::Cache::Simple->new); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
sub finish |
59
|
8
|
|
|
8
|
0
|
11
|
{ |
60
|
|
|
|
|
|
|
my $self = shift; |
61
|
8
|
|
|
|
|
10
|
|
62
|
|
|
|
|
|
|
my $keep = shift; |
63
|
8
|
|
|
|
|
13
|
|
64
|
|
|
|
|
|
|
foreach my $type (qw( expects normal )) |
65
|
16
|
|
|
|
|
22
|
{ |
66
|
|
|
|
|
|
|
my $caches = $self->{$type}; |
67
|
16
|
|
|
|
|
19
|
|
68
|
|
|
|
|
|
|
my $last = pop @$caches; |
69
|
16
|
100
|
|
|
|
79
|
|
70
|
|
|
|
|
|
|
$caches->[-1]->absorb($last) if $keep; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub type |
75
|
56
|
100
|
|
56
|
0
|
121
|
{ |
76
|
|
|
|
|
|
|
return $Test::Deep::Expects ? "expects" : "normal"; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
1; |