line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package YATT::Lite::Test::TestUtil; |
2
|
14
|
|
|
14
|
|
563597
|
use strict; |
|
14
|
|
|
|
|
32
|
|
|
14
|
|
|
|
|
439
|
|
3
|
14
|
|
|
14
|
|
1174
|
use warnings qw(FATAL all NONFATAL misc); |
|
14
|
|
|
|
|
1330
|
|
|
14
|
|
|
|
|
683
|
|
4
|
|
|
|
|
|
|
|
5
|
14
|
|
|
14
|
|
72
|
use Exporter qw/import/; |
|
14
|
|
|
|
|
1059
|
|
|
14
|
|
|
|
|
3976
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our @EXPORT = qw/eq_or_diff/; |
8
|
|
|
|
|
|
|
our @EXPORT_OK = (@EXPORT |
9
|
|
|
|
|
|
|
, qw/capture_stderr/); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
require Test::More; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
if (eval {require Test::Differences}) { |
14
|
|
|
|
|
|
|
*eq_or_diff = *Test::Differences::eq_or_diff; |
15
|
|
|
|
|
|
|
} else { |
16
|
|
|
|
|
|
|
*eq_or_diff = *Test::More::is; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub capture_stderr (&) { |
20
|
0
|
|
|
0
|
0
|
|
my ($sub) = @_; |
21
|
0
|
|
|
|
|
|
my $buffer = ""; |
22
|
|
|
|
|
|
|
{ |
23
|
0
|
|
|
|
|
|
open my $fh, '>', \$buffer; |
|
0
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
local *STDERR = *$fh; |
25
|
0
|
|
|
|
|
|
$sub->(); |
26
|
|
|
|
|
|
|
} |
27
|
0
|
|
|
|
|
|
$buffer; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |