line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
$Test::Spy::Interface::VERSION = '0.003'; |
2
|
|
|
|
|
|
|
use v5.10; |
3
|
6
|
|
|
6
|
|
59986
|
use strict; |
|
6
|
|
|
|
|
27
|
|
4
|
6
|
|
|
6
|
|
33
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
149
|
|
5
|
6
|
|
|
6
|
|
31
|
|
|
6
|
|
|
|
|
18
|
|
|
6
|
|
|
|
|
199
|
|
6
|
|
|
|
|
|
|
use Moo::Role; |
7
|
6
|
|
|
6
|
|
50
|
use Mooish::AttributeBuilder; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
35
|
|
8
|
6
|
|
|
6
|
|
2954
|
|
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
3230
|
|
9
|
|
|
|
|
|
|
requires qw( |
10
|
|
|
|
|
|
|
call_history |
11
|
|
|
|
|
|
|
_clear_call_history |
12
|
|
|
|
|
|
|
); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has field '_call_iterator' => ( |
15
|
|
|
|
|
|
|
writer => 1, |
16
|
|
|
|
|
|
|
clearer => 1, |
17
|
|
|
|
|
|
|
predicate => 1, |
18
|
|
|
|
|
|
|
lazy => sub { 0 }, |
19
|
|
|
|
|
|
|
); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
{ |
22
|
|
|
|
|
|
|
my ($self, $count) = @_; |
23
|
|
|
|
|
|
|
$count //= 1; |
24
|
7
|
|
|
7
|
|
17
|
|
25
|
7
|
|
50
|
|
|
31
|
$self->_set_call_iterator($self->_call_iterator + $count); |
26
|
|
|
|
|
|
|
|
27
|
7
|
|
|
|
|
148
|
return; |
28
|
|
|
|
|
|
|
} |
29
|
7
|
|
|
|
|
60
|
|
30
|
|
|
|
|
|
|
{ |
31
|
|
|
|
|
|
|
my ($self) = @_; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
return scalar @{$self->call_history}; |
34
|
26
|
|
|
26
|
0
|
62
|
} |
35
|
|
|
|
|
|
|
|
36
|
26
|
|
|
|
|
34
|
{ |
|
26
|
|
|
|
|
486
|
|
37
|
|
|
|
|
|
|
my ($self) = @_; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
return $self->call_history->[$self->_call_iterator]; |
40
|
|
|
|
|
|
|
} |
41
|
16
|
|
|
16
|
0
|
765
|
|
42
|
|
|
|
|
|
|
{ |
43
|
16
|
|
|
|
|
233
|
my ($self) = @_; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
$self->_set_call_iterator(0); |
46
|
|
|
|
|
|
|
return $self->called_with; |
47
|
|
|
|
|
|
|
} |
48
|
1
|
|
|
1
|
0
|
12
|
|
49
|
|
|
|
|
|
|
{ |
50
|
1
|
|
|
|
|
7
|
my ($self) = @_; |
51
|
1
|
|
|
|
|
6
|
|
52
|
|
|
|
|
|
|
$self->_increment_call_iterator |
53
|
|
|
|
|
|
|
if $self->_has_call_iterator; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
return $self->called_with; |
56
|
9
|
|
|
9
|
0
|
3045
|
} |
57
|
|
|
|
|
|
|
|
58
|
9
|
100
|
|
|
|
39
|
{ |
59
|
|
|
|
|
|
|
my ($self) = @_; |
60
|
|
|
|
|
|
|
|
61
|
9
|
|
|
|
|
18
|
$self->_set_call_iterator($self->called_times - 1); |
62
|
|
|
|
|
|
|
return $self->called_with; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
{ |
66
|
2
|
|
|
2
|
0
|
750
|
my ($self, $times) = @_; |
67
|
|
|
|
|
|
|
|
68
|
2
|
|
|
|
|
7
|
return $self->called_times == $times if defined $times; |
69
|
2
|
|
|
|
|
30
|
return $self->called_times > 0; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
{ |
73
|
|
|
|
|
|
|
my ($self) = @_; |
74
|
22
|
|
|
22
|
0
|
3506
|
|
75
|
|
|
|
|
|
|
return $self->was_called(0); |
76
|
22
|
100
|
|
|
|
88
|
} |
77
|
3
|
|
|
|
|
8
|
|
78
|
|
|
|
|
|
|
{ |
79
|
|
|
|
|
|
|
my ($self) = @_; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
return $self->was_called(1); |
82
|
3
|
|
|
3
|
0
|
21
|
} |
83
|
|
|
|
|
|
|
|
84
|
3
|
|
|
|
|
13
|
{ |
85
|
|
|
|
|
|
|
my ($self) = @_; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$self->_clear_call_history; |
88
|
|
|
|
|
|
|
$self->_clear_call_iterator; |
89
|
5
|
|
|
5
|
0
|
1041
|
|
90
|
|
|
|
|
|
|
return $self; |
91
|
5
|
|
|
|
|
17
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |
94
|
|
|
|
|
|
|
|