line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Event::Note; |
2
|
107
|
|
|
107
|
|
1145
|
use strict; |
|
107
|
|
|
|
|
200
|
|
|
107
|
|
|
|
|
2829
|
|
3
|
107
|
|
|
107
|
|
522
|
use warnings; |
|
107
|
|
|
|
|
186
|
|
|
107
|
|
|
|
|
3025
|
|
4
|
|
|
|
|
|
|
|
5
|
107
|
|
|
107
|
|
529
|
use Test::Stream::Formatter::TAP qw/OUT_STD/; |
|
107
|
|
|
|
|
200
|
|
|
107
|
|
|
|
|
743
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Test::Stream::Event( |
8
|
107
|
|
|
|
|
817
|
accessors => [qw/message/], |
9
|
107
|
|
|
107
|
|
573
|
); |
|
107
|
|
|
|
|
219
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub init { |
12
|
22
|
|
|
22
|
0
|
111
|
$_[0]->SUPER::init(); |
13
|
22
|
100
|
|
|
|
67
|
if (defined $_[0]->{+MESSAGE}) { |
14
|
21
|
|
|
|
|
74
|
$_[0]->{+MESSAGE} .= ""; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
else { |
17
|
1
|
|
|
|
|
3
|
$_[0]->{+MESSAGE} = 'undef'; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub to_tap { |
22
|
10
|
|
|
10
|
1
|
28
|
my $self = shift; |
23
|
|
|
|
|
|
|
|
24
|
10
|
|
|
|
|
27
|
chomp(my $msg = $self->{+MESSAGE}); |
25
|
10
|
100
|
|
|
|
33
|
return unless $msg; |
26
|
8
|
100
|
|
|
|
36
|
$msg = "# $msg" unless $msg =~ m/^\n/; |
27
|
8
|
|
|
|
|
25
|
$msg =~ s/\n/\n# /g; |
28
|
|
|
|
|
|
|
|
29
|
8
|
|
|
|
|
55
|
return [OUT_STD, "$msg\n"]; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |