line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
$Test::Spy::Interface::VERSION = '0.005'; |
2
|
|
|
|
|
|
|
use v5.10; |
3
|
7
|
|
|
7
|
|
60179
|
use strict; |
|
7
|
|
|
|
|
24
|
|
4
|
7
|
|
|
7
|
|
34
|
use warnings; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
155
|
|
5
|
7
|
|
|
7
|
|
50
|
|
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
182
|
|
6
|
|
|
|
|
|
|
use Moo::Role; |
7
|
7
|
|
|
7
|
|
31
|
use Mooish::AttributeBuilder -standard; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
35
|
|
8
|
7
|
|
|
7
|
|
3034
|
|
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
55
|
|
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
|
|
10
|
|
25
|
7
|
|
50
|
|
|
29
|
$self->_set_call_iterator($self->_call_iterator + $count); |
26
|
|
|
|
|
|
|
|
27
|
7
|
|
|
|
|
118
|
return; |
28
|
|
|
|
|
|
|
} |
29
|
7
|
|
|
|
|
48
|
|
30
|
|
|
|
|
|
|
{ |
31
|
|
|
|
|
|
|
my ($self) = @_; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
return scalar @{$self->call_history}; |
34
|
26
|
|
|
26
|
0
|
42
|
} |
35
|
|
|
|
|
|
|
|
36
|
26
|
|
|
|
|
28
|
{ |
|
26
|
|
|
|
|
443
|
|
37
|
|
|
|
|
|
|
my ($self) = @_; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
return $self->call_history->[$self->_call_iterator]; |
40
|
|
|
|
|
|
|
} |
41
|
16
|
|
|
16
|
0
|
607
|
|
42
|
|
|
|
|
|
|
{ |
43
|
16
|
|
|
|
|
198
|
my ($self) = @_; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
$self->_set_call_iterator(0); |
46
|
|
|
|
|
|
|
return $self->called_with; |
47
|
|
|
|
|
|
|
} |
48
|
1
|
|
|
1
|
0
|
10
|
|
49
|
|
|
|
|
|
|
{ |
50
|
1
|
|
|
|
|
6
|
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
|
2403
|
} |
57
|
|
|
|
|
|
|
|
58
|
9
|
100
|
|
|
|
45
|
{ |
59
|
|
|
|
|
|
|
my ($self) = @_; |
60
|
|
|
|
|
|
|
|
61
|
9
|
|
|
|
|
16
|
$self->_set_call_iterator($self->called_times - 1); |
62
|
|
|
|
|
|
|
return $self->called_with; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
{ |
66
|
2
|
|
|
2
|
0
|
589
|
my ($self, $times) = @_; |
67
|
|
|
|
|
|
|
|
68
|
2
|
|
|
|
|
6
|
return $self->called_times == $times if defined $times; |
69
|
2
|
|
|
|
|
20
|
return $self->called_times > 0; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
{ |
73
|
|
|
|
|
|
|
my ($self) = @_; |
74
|
22
|
|
|
22
|
0
|
2805
|
|
75
|
|
|
|
|
|
|
return $self->was_called(0); |
76
|
22
|
100
|
|
|
|
72
|
} |
77
|
3
|
|
|
|
|
7
|
|
78
|
|
|
|
|
|
|
{ |
79
|
|
|
|
|
|
|
my ($self) = @_; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
return $self->was_called(1); |
82
|
3
|
|
|
3
|
0
|
18
|
} |
83
|
|
|
|
|
|
|
|
84
|
3
|
|
|
|
|
12
|
{ |
85
|
|
|
|
|
|
|
my ($self) = @_; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$self->_clear_call_history; |
88
|
|
|
|
|
|
|
$self->_clear_call_iterator; |
89
|
5
|
|
|
5
|
0
|
836
|
|
90
|
|
|
|
|
|
|
return $self; |
91
|
5
|
|
|
|
|
80
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |
94
|
|
|
|
|
|
|
|