line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Event::Ok; |
2
|
57
|
|
|
57
|
|
473
|
use strict; |
|
57
|
|
|
|
|
56
|
|
|
57
|
|
|
|
|
1208
|
|
3
|
57
|
|
|
57
|
|
164
|
use warnings; |
|
57
|
|
|
|
|
39
|
|
|
57
|
|
|
|
|
1666
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000044'; |
6
|
|
|
|
|
|
|
|
7
|
57
|
|
|
57
|
|
188
|
use base 'Test2::Event'; |
|
57
|
|
|
|
|
70
|
|
|
57
|
|
|
|
|
18398
|
|
8
|
57
|
|
|
|
|
169
|
use Test2::Util::HashBase qw{ |
9
|
|
|
|
|
|
|
pass effective_pass name todo |
10
|
57
|
|
|
57
|
|
227
|
}; |
|
57
|
|
|
|
|
56
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub init { |
13
|
1045
|
|
|
1045
|
0
|
798
|
my $self = shift; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# Do not store objects here, only true or false |
16
|
1045
|
100
|
|
|
|
2021
|
$self->{+PASS} = $self->{+PASS} ? 1 : 0; |
17
|
1045
|
|
66
|
|
|
2398
|
$self->{+EFFECTIVE_PASS} = $self->{+PASS} || (defined($self->{+TODO}) ? 1 : 0); |
18
|
|
|
|
|
|
|
|
19
|
1045
|
100
|
|
|
|
1616
|
my $name = $self->{+NAME} or return; |
20
|
1026
|
100
|
100
|
|
|
4958
|
return unless index($name, '#') != -1 || index($name, "\n") != -1; |
21
|
2
|
|
|
|
|
15
|
$self->trace->throw("'$name' is not a valid name, names must not contain '#' or newlines.") |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
{ |
25
|
57
|
|
|
57
|
|
235
|
no warnings 'redefine'; |
|
57
|
|
|
|
|
55
|
|
|
57
|
|
|
|
|
9163
|
|
26
|
|
|
|
|
|
|
sub set_todo { |
27
|
9
|
|
|
9
|
|
28
|
my $self = shift; |
28
|
9
|
|
|
|
|
9
|
my ($todo) = @_; |
29
|
9
|
|
|
|
|
14
|
$self->{+TODO} = $todo; |
30
|
9
|
100
|
|
|
|
21
|
$self->{+EFFECTIVE_PASS} = defined($todo) ? 1 : $self->{+PASS}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
205
|
|
|
205
|
1
|
409
|
sub increments_count { 1 }; |
35
|
|
|
|
|
|
|
|
36
|
42
|
|
|
42
|
1
|
85
|
sub causes_fail { !$_[0]->{+EFFECTIVE_PASS} } |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub summary { |
39
|
7
|
|
|
7
|
1
|
11
|
my $self = shift; |
40
|
|
|
|
|
|
|
|
41
|
7
|
|
100
|
|
|
16
|
my $name = $self->{+NAME} || "Nameless Assertion"; |
42
|
|
|
|
|
|
|
|
43
|
7
|
|
|
|
|
8
|
my $todo = $self->{+TODO}; |
44
|
7
|
100
|
|
|
|
16
|
if ($todo) { |
|
|
100
|
|
|
|
|
|
45
|
1
|
|
|
|
|
2
|
$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__ |