line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Event::Ok; |
2
|
54
|
|
|
54
|
|
481
|
use strict; |
|
54
|
|
|
|
|
52
|
|
|
54
|
|
|
|
|
1150
|
|
3
|
54
|
|
|
54
|
|
148
|
use warnings; |
|
54
|
|
|
|
|
41
|
|
|
54
|
|
|
|
|
1557
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000042'; |
6
|
|
|
|
|
|
|
|
7
|
54
|
|
|
54
|
|
164
|
use base 'Test2::Event'; |
|
54
|
|
|
|
|
44
|
|
|
54
|
|
|
|
|
16008
|
|
8
|
54
|
|
|
|
|
153
|
use Test2::Util::HashBase qw{ |
9
|
|
|
|
|
|
|
pass effective_pass name todo |
10
|
54
|
|
|
54
|
|
188
|
}; |
|
54
|
|
|
|
|
47
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub init { |
13
|
1024
|
|
|
1024
|
0
|
779
|
my $self = shift; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Do not store objects here, only true or false |
16
|
1024
|
100
|
|
|
|
1963
|
$self->{+PASS} = $self->{+PASS} ? 1 : 0; |
17
|
1024
|
|
66
|
|
|
2279
|
$self->{+EFFECTIVE_PASS} = $self->{+PASS} || (defined($self->{+TODO}) ? 1 : 0); |
18
|
|
|
|
|
|
|
|
19
|
1024
|
100
|
|
|
|
1769
|
my $name = $self->{+NAME} or return; |
20
|
1007
|
100
|
100
|
|
|
4756
|
return unless index($name, '#') != -1 || index($name, "\n") != -1; |
21
|
2
|
|
|
|
|
6
|
$self->trace->throw("'$name' is not a valid name, names must not contain '#' or newlines.") |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
{ |
25
|
54
|
|
|
54
|
|
220
|
no warnings 'redefine'; |
|
54
|
|
|
|
|
60
|
|
|
54
|
|
|
|
|
8991
|
|
26
|
|
|
|
|
|
|
sub set_todo { |
27
|
9
|
|
|
9
|
|
26
|
my $self = shift; |
28
|
9
|
|
|
|
|
12
|
my ($todo) = @_; |
29
|
9
|
|
|
|
|
29
|
$self->{+TODO} = $todo; |
30
|
9
|
100
|
|
|
|
22
|
$self->{+EFFECTIVE_PASS} = defined($todo) ? 1 : $self->{+PASS}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
202
|
|
|
202
|
1
|
402
|
sub increments_count { 1 }; |
35
|
|
|
|
|
|
|
|
36
|
41
|
|
|
41
|
1
|
73
|
sub causes_fail { !$_[0]->{+EFFECTIVE_PASS} } |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub summary { |
39
|
7
|
|
|
7
|
1
|
11
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
7
|
|
100
|
|
|
15
|
my $name = $self->{+NAME} || "Nameless Assertion"; |
42
|
|
|
|
|
|
|
|
43
|
7
|
|
|
|
|
9
|
my $todo = $self->{+TODO}; |
44
|
7
|
100
|
|
|
|
15
|
if ($todo) { |
|
|
100
|
|
|
|
|
|
45
|
1
|
|
|
|
|
3
|
$name .= " (TODO: $todo)"; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
elsif (defined $todo) { |
48
|
1
|
|
|
|
|
2
|
$name .= " (TODO)" |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
7
|
|
|
|
|
14
|
return $name; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |