line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package YATT::Lite::Test::TestUtil; |
2
|
14
|
|
|
14
|
|
368122
|
use strict; |
|
14
|
|
|
|
|
33
|
|
|
14
|
|
|
|
|
435
|
|
3
|
14
|
|
|
14
|
|
70
|
use warnings qw(FATAL all NONFATAL misc); |
|
14
|
|
|
|
|
31
|
|
|
14
|
|
|
|
|
532
|
|
4
|
|
|
|
|
|
|
|
5
|
14
|
|
|
14
|
|
264
|
use Exporter qw/import/; |
|
14
|
|
|
|
|
34
|
|
|
14
|
|
|
|
|
2249
|
|
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; |