line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Event::Ok; |
2
|
246
|
|
|
246
|
|
2062
|
use strict; |
|
246
|
|
|
|
|
474
|
|
|
246
|
|
|
|
|
7296
|
|
3
|
246
|
|
|
246
|
|
1309
|
use warnings; |
|
246
|
|
|
|
|
511
|
|
|
246
|
|
|
|
|
14078
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.302180'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
246
|
|
|
246
|
|
114036
|
BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) } |
|
246
|
|
|
|
|
12318
|
|
9
|
246
|
|
|
|
|
1364
|
use Test2::Util::HashBase qw{ |
10
|
|
|
|
|
|
|
pass effective_pass name todo |
11
|
246
|
|
|
246
|
|
1792
|
}; |
|
246
|
|
|
|
|
534
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub init { |
14
|
213
|
|
|
213
|
0
|
451
|
my $self = shift; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Do not store objects here, only true or false |
17
|
213
|
100
|
|
|
|
883
|
$self->{+PASS} = $self->{+PASS} ? 1 : 0; |
18
|
213
|
|
100
|
|
|
1125
|
$self->{+EFFECTIVE_PASS} = $self->{+PASS} || (defined($self->{+TODO}) ? 1 : 0); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
{ |
22
|
246
|
|
|
246
|
|
2209
|
no warnings 'redefine'; |
|
246
|
|
|
|
|
548
|
|
|
246
|
|
|
|
|
110159
|
|
23
|
|
|
|
|
|
|
sub set_todo { |
24
|
317
|
|
|
317
|
|
507
|
my $self = shift; |
25
|
317
|
|
|
|
|
654
|
my ($todo) = @_; |
26
|
317
|
|
|
|
|
857
|
$self->{+TODO} = $todo; |
27
|
317
|
100
|
|
|
|
923
|
$self->{+EFFECTIVE_PASS} = defined($todo) ? 1 : $self->{+PASS}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
3
|
1
|
24
|
sub increments_count { 1 }; |
32
|
|
|
|
|
|
|
|
33
|
2
|
|
|
2
|
1
|
12
|
sub causes_fail { !$_[0]->{+EFFECTIVE_PASS} } |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub summary { |
36
|
7
|
|
|
7
|
1
|
15
|
my $self = shift; |
37
|
|
|
|
|
|
|
|
38
|
7
|
|
100
|
|
|
27
|
my $name = $self->{+NAME} || "Nameless Assertion"; |
39
|
|
|
|
|
|
|
|
40
|
7
|
|
|
|
|
13
|
my $todo = $self->{+TODO}; |
41
|
7
|
100
|
|
|
|
24
|
if ($todo) { |
|
|
100
|
|
|
|
|
|
42
|
1
|
|
|
|
|
3
|
$name .= " (TODO: $todo)"; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
elsif (defined $todo) { |
45
|
1
|
|
|
|
|
3
|
$name .= " (TODO)" |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
7
|
|
|
|
|
29
|
return $name; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub extra_amnesty { |
52
|
1157
|
|
|
1157
|
0
|
1730
|
my $self = shift; |
53
|
1157
|
100
|
100
|
|
|
5603
|
return unless defined($self->{+TODO}) || ($self->{+EFFECTIVE_PASS} && !$self->{+PASS}); |
|
|
|
100
|
|
|
|
|
54
|
|
|
|
|
|
|
return { |
55
|
|
|
|
|
|
|
tag => 'TODO', |
56
|
462
|
|
|
|
|
1736
|
details => $self->{+TODO}, |
57
|
|
|
|
|
|
|
}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub facet_data { |
61
|
1197
|
|
|
1197
|
1
|
1896
|
my $self = shift; |
62
|
|
|
|
|
|
|
|
63
|
1197
|
|
|
|
|
3249
|
my $out = $self->common_facet_data; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
$out->{assert} = { |
66
|
|
|
|
|
|
|
no_debug => 1, # Legacy behavior |
67
|
|
|
|
|
|
|
pass => $self->{+PASS}, |
68
|
1197
|
|
|
|
|
4259
|
details => $self->{+NAME}, |
69
|
|
|
|
|
|
|
}; |
70
|
|
|
|
|
|
|
|
71
|
1197
|
100
|
|
|
|
3209
|
if (my @exra_amnesty = $self->extra_amnesty) { |
72
|
502
|
|
|
|
|
871
|
my %seen; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# It is possible the extra amnesty can be a duplicate, so filter it. |
75
|
|
|
|
|
|
|
$out->{amnesty} = [ |
76
|
781
|
100
|
|
|
|
4450
|
grep { !$seen{defined($_->{tag}) ? $_->{tag} : ''}->{defined($_->{details}) ? $_->{details} : ''}++ } |
|
|
50
|
|
|
|
|
|
77
|
|
|
|
|
|
|
@exra_amnesty, |
78
|
502
|
|
|
|
|
741
|
@{$out->{amnesty}}, |
|
502
|
|
|
|
|
1193
|
|
79
|
|
|
|
|
|
|
]; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
1197
|
|
|
|
|
3923
|
return $out; |
83
|
|
|
|
|
|
|
} |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
1; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
__END__ |