line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Stream::Event::Diag; |
2
|
107
|
|
|
107
|
|
1070
|
use strict; |
|
107
|
|
|
|
|
228
|
|
|
107
|
|
|
|
|
2638
|
|
3
|
107
|
|
|
107
|
|
591
|
use warnings; |
|
107
|
|
|
|
|
187
|
|
|
107
|
|
|
|
|
3509
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use Test::Stream::Event( |
6
|
107
|
|
|
|
|
577
|
accessors => [qw/message/], |
7
|
107
|
|
|
107
|
|
56017
|
); |
|
107
|
|
|
|
|
263
|
|
8
|
|
|
|
|
|
|
|
9
|
107
|
|
|
107
|
|
591
|
use Carp qw/confess/; |
|
107
|
|
|
|
|
191
|
|
|
107
|
|
|
|
|
4957
|
|
10
|
|
|
|
|
|
|
|
11
|
107
|
|
|
107
|
|
592
|
use Test::Stream::Formatter::TAP qw/OUT_TODO OUT_ERR/; |
|
107
|
|
|
|
|
196
|
|
|
107
|
|
|
|
|
751
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub init { |
14
|
28
|
|
|
28
|
0
|
225
|
$_[0]->SUPER::init(); |
15
|
28
|
100
|
|
|
|
113
|
if (defined $_[0]->{+MESSAGE}) { |
16
|
26
|
|
|
|
|
95
|
$_[0]->{+MESSAGE} .= ""; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
else { |
19
|
2
|
|
|
|
|
8
|
$_[0]->{+MESSAGE} = 'undef'; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub to_tap { |
24
|
13
|
|
|
13
|
1
|
46
|
my $self = shift; |
25
|
|
|
|
|
|
|
|
26
|
13
|
|
|
|
|
28
|
my $msg = $self->{+MESSAGE}; |
27
|
13
|
100
|
|
|
|
37
|
return unless $msg; |
28
|
|
|
|
|
|
|
|
29
|
12
|
100
|
|
|
|
44
|
$msg = "# $msg" unless $msg eq "\n"; |
30
|
|
|
|
|
|
|
|
31
|
12
|
|
|
|
|
29
|
chomp($msg); |
32
|
12
|
|
|
|
|
51
|
$msg =~ s/\n/\n# /g; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
return [ |
35
|
12
|
100
|
|
|
|
51
|
($self->{+DEBUG}->no_diag ? OUT_TODO : OUT_ERR), |
36
|
|
|
|
|
|
|
"$msg\n", |
37
|
|
|
|
|
|
|
]; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |