line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
$Test::Spy::Interface::VERSION = '0.004'; |
2
|
|
|
|
|
|
|
use v5.10; |
3
|
6
|
|
|
6
|
|
57445
|
use strict; |
|
6
|
|
|
|
|
24
|
|
4
|
6
|
|
|
6
|
|
34
|
use warnings; |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
161
|
|
5
|
6
|
|
|
6
|
|
30
|
|
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
220
|
|
6
|
|
|
|
|
|
|
use Moo::Role; |
7
|
6
|
|
|
6
|
|
33
|
use Mooish::AttributeBuilder -standard; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
57
|
|
8
|
6
|
|
|
6
|
|
2883
|
|
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
41
|
|
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
|
|
16
|
|
25
|
7
|
|
50
|
|
|
31
|
$self->_set_call_iterator($self->_call_iterator + $count); |
26
|
|
|
|
|
|
|
|
27
|
7
|
|
|
|
|
147
|
return; |
28
|
|
|
|
|
|
|
} |
29
|
7
|
|
|
|
|
62
|
|
30
|
|
|
|
|
|
|
{ |
31
|
|
|
|
|
|
|
my ($self) = @_; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
return scalar @{$self->call_history}; |
34
|
26
|
|
|
26
|
0
|
57
|
} |
35
|
|
|
|
|
|
|
|
36
|
26
|
|
|
|
|
36
|
{ |
|
26
|
|
|
|
|
489
|
|
37
|
|
|
|
|
|
|
my ($self) = @_; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
return $self->call_history->[$self->_call_iterator]; |
40
|
|
|
|
|
|
|
} |
41
|
16
|
|
|
16
|
0
|
743
|
|
42
|
|
|
|
|
|
|
{ |
43
|
16
|
|
|
|
|
233
|
my ($self) = @_; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
$self->_set_call_iterator(0); |
46
|
|
|
|
|
|
|
return $self->called_with; |
47
|
|
|
|
|
|
|
} |
48
|
1
|
|
|
1
|
0
|
13
|
|
49
|
|
|
|
|
|
|
{ |
50
|
1
|
|
|
|
|
8
|
my ($self) = @_; |
51
|
1
|
|
|
|
|
5
|
|
52
|
|
|
|
|
|
|
$self->_increment_call_iterator |
53
|
|
|
|
|
|
|
if $self->_has_call_iterator; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
return $self->called_with; |
56
|
9
|
|
|
9
|
0
|
2969
|
} |
57
|
|
|
|
|
|
|
|
58
|
9
|
100
|
|
|
|
42
|
{ |
59
|
|
|
|
|
|
|
my ($self) = @_; |
60
|
|
|
|
|
|
|
|
61
|
9
|
|
|
|
|
21
|
$self->_set_call_iterator($self->called_times - 1); |
62
|
|
|
|
|
|
|
return $self->called_with; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
{ |
66
|
2
|
|
|
2
|
0
|
721
|
my ($self, $times) = @_; |
67
|
|
|
|
|
|
|
|
68
|
2
|
|
|
|
|
6
|
return $self->called_times == $times if defined $times; |
69
|
2
|
|
|
|
|
21
|
return $self->called_times > 0; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
{ |
73
|
|
|
|
|
|
|
my ($self) = @_; |
74
|
22
|
|
|
22
|
0
|
3592
|
|
75
|
|
|
|
|
|
|
return $self->was_called(0); |
76
|
22
|
100
|
|
|
|
98
|
} |
77
|
3
|
|
|
|
|
8
|
|
78
|
|
|
|
|
|
|
{ |
79
|
|
|
|
|
|
|
my ($self) = @_; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
return $self->was_called(1); |
82
|
3
|
|
|
3
|
0
|
22
|
} |
83
|
|
|
|
|
|
|
|
84
|
3
|
|
|
|
|
14
|
{ |
85
|
|
|
|
|
|
|
my ($self) = @_; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$self->_clear_call_history; |
88
|
|
|
|
|
|
|
$self->_clear_call_iterator; |
89
|
5
|
|
|
5
|
0
|
1054
|
|
90
|
|
|
|
|
|
|
return $self; |
91
|
5
|
|
|
|
|
46
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |
94
|
|
|
|
|
|
|
|