line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
40
|
|
|
40
|
|
67677
|
use strict; |
|
40
|
|
|
|
|
89
|
|
|
40
|
|
|
|
|
1111
|
|
2
|
40
|
|
|
40
|
|
194
|
use warnings; |
|
40
|
|
|
|
|
72
|
|
|
40
|
|
|
|
|
1542
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Test::Deep::Cache 1.202; |
5
|
|
|
|
|
|
|
|
6
|
40
|
|
|
40
|
|
15917
|
use Test::Deep::Cache::Simple; |
|
40
|
|
|
|
|
104
|
|
|
40
|
|
|
|
|
13329
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new |
9
|
|
|
|
|
|
|
{ |
10
|
457
|
|
|
457
|
0
|
815
|
my $pkg = shift; |
11
|
|
|
|
|
|
|
|
12
|
457
|
|
|
|
|
858
|
my $self = bless {}, $pkg; |
13
|
|
|
|
|
|
|
|
14
|
457
|
|
|
|
|
1307
|
$self->{expects} = [Test::Deep::Cache::Simple->new]; |
15
|
457
|
|
|
|
|
1089
|
$self->{normal} = [Test::Deep::Cache::Simple->new]; |
16
|
|
|
|
|
|
|
|
17
|
457
|
|
|
|
|
1132
|
$self->local; |
18
|
|
|
|
|
|
|
|
19
|
457
|
|
|
|
|
955
|
return $self; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub add |
23
|
|
|
|
|
|
|
{ |
24
|
1137
|
|
|
1137
|
0
|
1617
|
my $self = shift; |
25
|
|
|
|
|
|
|
|
26
|
1137
|
|
|
|
|
1881
|
my $type = $self->type; |
27
|
|
|
|
|
|
|
|
28
|
1137
|
|
|
|
|
2965
|
$self->{$type}->[-1]->add(@_); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub cmp |
32
|
|
|
|
|
|
|
{ |
33
|
|
|
|
|
|
|
# go through all the caches to see if we know this one |
34
|
|
|
|
|
|
|
|
35
|
1176
|
|
|
1176
|
0
|
1730
|
my $self = shift; |
36
|
|
|
|
|
|
|
|
37
|
1176
|
|
|
|
|
2133
|
my $type = $self->type; |
38
|
|
|
|
|
|
|
|
39
|
1176
|
|
|
|
|
1754
|
foreach my $cache (@{$self->{$type}}) |
|
1176
|
|
|
|
|
2457
|
|
40
|
|
|
|
|
|
|
{ |
41
|
2506
|
100
|
|
|
|
5463
|
return 1 if $cache->cmp(@_); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
1136
|
|
|
|
|
2616
|
return 0 |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub local |
48
|
|
|
|
|
|
|
{ |
49
|
891
|
|
|
891
|
0
|
1257
|
my $self = shift; |
50
|
|
|
|
|
|
|
|
51
|
891
|
|
|
|
|
1618
|
foreach my $type (qw( expects normal )) |
52
|
|
|
|
|
|
|
{ |
53
|
1782
|
|
|
|
|
2374
|
push(@{$self->{$type}}, Test::Deep::Cache::Simple->new); |
|
1782
|
|
|
|
|
4056
|
|
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub finish |
58
|
|
|
|
|
|
|
{ |
59
|
434
|
|
|
434
|
0
|
575
|
my $self = shift; |
60
|
|
|
|
|
|
|
|
61
|
434
|
|
|
|
|
548
|
my $keep = shift; |
62
|
|
|
|
|
|
|
|
63
|
434
|
|
|
|
|
690
|
foreach my $type (qw( expects normal )) |
64
|
|
|
|
|
|
|
{ |
65
|
868
|
|
|
|
|
1304
|
my $caches = $self->{$type}; |
66
|
|
|
|
|
|
|
|
67
|
868
|
|
|
|
|
1143
|
my $last = pop @$caches; |
68
|
|
|
|
|
|
|
|
69
|
868
|
100
|
|
|
|
2211
|
$caches->[-1]->absorb($last) if $keep; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub type |
74
|
|
|
|
|
|
|
{ |
75
|
2313
|
100
|
|
2313
|
0
|
4503
|
return $Test::Deep::Expects ? "expects" : "normal"; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
__END__ |