line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Event::Note; |
2
|
107
|
|
|
107
|
|
1068
|
use strict; |
|
107
|
|
|
|
|
236
|
|
|
107
|
|
|
|
|
2769
|
|
3
|
107
|
|
|
107
|
|
510
|
use warnings; |
|
107
|
|
|
|
|
190
|
|
|
107
|
|
|
|
|
3012
|
|
4
|
|
|
|
|
|
|
|
5
|
107
|
|
|
107
|
|
527
|
use Test::Stream::Formatter::TAP qw/OUT_STD/; |
|
107
|
|
|
|
|
185
|
|
|
107
|
|
|
|
|
769
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Test::Stream::Event( |
8
|
107
|
|
|
|
|
800
|
accessors => [qw/message/], |
9
|
107
|
|
|
107
|
|
575
|
); |
|
107
|
|
|
|
|
207
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub init { |
12
|
22
|
|
|
22
|
0
|
133
|
$_[0]->SUPER::init(); |
13
|
22
|
100
|
|
|
|
66
|
if (defined $_[0]->{+MESSAGE}) { |
14
|
21
|
|
|
|
|
74
|
$_[0]->{+MESSAGE} .= ""; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
else { |
17
|
1
|
|
|
|
|
4
|
$_[0]->{+MESSAGE} = 'undef'; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub to_tap { |
22
|
10
|
|
|
10
|
1
|
28
|
my $self = shift; |
23
|
|
|
|
|
|
|
|
24
|
10
|
|
|
|
|
29
|
chomp(my $msg = $self->{+MESSAGE}); |
25
|
10
|
100
|
|
|
|
35
|
return unless $msg; |
26
|
8
|
100
|
|
|
|
36
|
$msg = "# $msg" unless $msg =~ m/^\n/; |
27
|
8
|
|
|
|
|
26
|
$msg =~ s/\n/\n# /g; |
28
|
|
|
|
|
|
|
|
29
|
8
|
|
|
|
|
50
|
return [OUT_STD, "$msg\n"]; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |