line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Kantan::Suite; |
2
|
3
|
|
|
3
|
|
12
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
78
|
|
3
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
55
|
|
4
|
3
|
|
|
3
|
|
12
|
use utf8; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
13
|
|
5
|
3
|
|
|
3
|
|
81
|
use 5.010_001; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
100
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
12
|
use Moo; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
14
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has title => ( is => 'ro', required => 1 ); |
10
|
|
|
|
|
|
|
has root => ( is => 'ro' ); |
11
|
|
|
|
|
|
|
has parent => ( is => 'ro' ); |
12
|
|
|
|
|
|
|
has triggers => ( is => 'ro', default => sub { +{} } ); |
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
1009
|
no Moo; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
11
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub call_trigger { |
17
|
6
|
|
|
6
|
0
|
9
|
my ($self, $trigger_name) = @_; |
18
|
6
|
|
|
|
|
8
|
for my $trigger (@{$self->{triggers}->{$trigger_name}}) { |
|
6
|
|
|
|
|
33
|
|
19
|
0
|
|
|
|
|
|
$trigger->(); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub add_trigger { |
24
|
0
|
|
|
0
|
0
|
|
my ($self, $trigger_name, $code) = @_; |
25
|
0
|
|
|
|
|
|
push @{$self->{triggers}->{$trigger_name}}, $code; |
|
0
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|