line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Power; |
2
|
3
|
|
|
3
|
|
56029
|
use 5.014000; |
|
3
|
|
|
|
|
15
|
|
|
3
|
|
|
|
|
247
|
|
3
|
3
|
|
|
3
|
|
20
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
130
|
|
4
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
179
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.14"; |
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
3003
|
use parent qw(Exporter); |
|
3
|
|
|
|
|
974
|
|
|
3
|
|
|
|
|
17
|
|
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
162
|
use Test::More 0.98 (); |
|
3
|
|
|
|
|
85
|
|
|
3
|
|
|
|
|
56
|
|
11
|
3
|
|
|
3
|
|
3830
|
use Data::Dumper (); |
|
3
|
|
|
|
|
33468
|
|
|
3
|
|
|
|
|
92
|
|
12
|
3
|
|
|
3
|
|
2759
|
use Text::Truncate qw(truncstr); |
|
3
|
|
|
|
|
2094
|
|
|
3
|
|
|
|
|
196
|
|
13
|
3
|
|
|
3
|
|
2558
|
use Devel::CodeObserver 0.11; |
|
3
|
|
|
|
|
21381
|
|
|
3
|
|
|
|
|
85
|
|
14
|
|
|
|
|
|
|
|
15
|
3
|
|
|
3
|
|
1598
|
use Test::Power::FromLine; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
137
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our @EXPORT = qw(expect); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
use constant { |
20
|
3
|
|
|
|
|
861
|
RESULT_VALUE => 0, |
21
|
|
|
|
|
|
|
RESULT_OPINDEX => 1, |
22
|
3
|
|
|
3
|
|
16
|
}; |
|
3
|
|
|
|
|
6
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
our $DUMP_CUTOFF = 80; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub expect(&;$) { |
27
|
3
|
|
|
3
|
1
|
3859
|
my ($code, $description) = @_; |
28
|
|
|
|
|
|
|
|
29
|
3
|
|
|
|
|
15
|
my ($package, $filename, $line_no, $line) = Test::Power::FromLine::inspect_line(0); |
30
|
3
|
50
|
33
|
|
|
26
|
$description ||= "L$line_no" . (length($line) ? " : $line" : ''); |
31
|
|
|
|
|
|
|
|
32
|
3
|
|
|
|
|
22
|
my $BUILDER = Test::More->builder; |
33
|
|
|
|
|
|
|
|
34
|
3
|
|
|
|
|
61
|
my ($retval, $result) = Devel::CodeObserver->new->call($code); |
35
|
|
|
|
|
|
|
|
36
|
3
|
|
|
|
|
970
|
$BUILDER->ok($retval, $description); |
37
|
|
|
|
|
|
|
|
38
|
3
|
100
|
|
|
|
636
|
unless ($retval) { |
39
|
1
|
|
|
|
|
2
|
for my $pair (@{$result->dump_pairs}) { |
|
1
|
|
|
|
|
4
|
|
40
|
1
|
|
|
|
|
728
|
my ($code, $dump) = @$pair; |
41
|
1
|
|
|
|
|
10
|
$BUILDER->diag("${code}"); |
42
|
1
|
|
|
|
|
43
|
$BUILDER->diag(" => " . truncstr($dump, $DUMP_CUTOFF, '...')); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
__END__ |