line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Kantan::Suite; |
2
|
3
|
|
|
3
|
|
12
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
85
|
|
3
|
3
|
|
|
3
|
|
12
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
52
|
|
4
|
3
|
|
|
3
|
|
9
|
use utf8; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
10
|
|
5
|
3
|
|
|
3
|
|
67
|
use 5.010_001; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
85
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
10
|
use Moo; |
|
3
|
|
|
|
|
2
|
|
|
3
|
|
|
|
|
10
|
|
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
|
|
1129
|
no Moo; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
9
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub call_trigger { |
17
|
6
|
|
|
6
|
0
|
12
|
my ($self, $trigger_name) = @_; |
18
|
6
|
|
|
|
|
10
|
for my $trigger (@{$self->{triggers}->{$trigger_name}}) { |
|
6
|
|
|
|
|
41
|
|
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
|
|
|
|
|
|
|
|