| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Test::More::Behaviour::Helper; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
22136
|
use strict; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
74
|
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
68
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
16
|
use Exporter qw(import); |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
67
|
|
|
7
|
2
|
|
|
2
|
|
8
|
use Test::More; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
10
|
|
|
8
|
2
|
|
|
2
|
|
3504
|
use Term::ANSIColor qw(colored); |
|
|
2
|
|
|
|
|
25185
|
|
|
|
2
|
|
|
|
|
1843
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @EXPORT = qw(evaluate_and_print_subtest spec_description context_description); |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $spec_description; |
|
13
|
|
|
|
|
|
|
my $context_description; |
|
14
|
|
|
|
|
|
|
my $passed = 1; |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub evaluate_and_print_subtest { |
|
17
|
19
|
|
|
19
|
0
|
33
|
my ($description, $block) = @_; |
|
18
|
|
|
|
|
|
|
|
|
19
|
19
|
|
|
|
|
36
|
print _subtest(_construct_description($description) => _subtest_block($block)); |
|
20
|
|
|
|
|
|
|
|
|
21
|
19
|
|
|
|
|
954
|
return; |
|
22
|
|
|
|
|
|
|
} |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _subtest { |
|
25
|
19
|
|
|
19
|
|
27
|
my ($description, $block) = @_; |
|
26
|
|
|
|
|
|
|
|
|
27
|
19
|
|
|
|
|
31
|
$block->(); |
|
28
|
19
|
|
|
|
|
72
|
return $description->(),"\n"; |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _subtest_block { |
|
32
|
19
|
|
|
19
|
|
29
|
my $block = shift; |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
return sub { |
|
35
|
|
|
|
|
|
|
eval { |
|
36
|
19
|
|
|
|
|
41
|
$passed = $block->(); |
|
37
|
19
|
|
|
|
|
5667
|
1; |
|
38
|
19
|
50
|
|
19
|
|
23
|
} or do { |
|
39
|
0
|
|
|
|
|
0
|
$passed = 0; |
|
40
|
0
|
|
|
|
|
0
|
fail($@); |
|
41
|
|
|
|
|
|
|
}; |
|
42
|
19
|
|
|
|
|
76
|
}; |
|
43
|
|
|
|
|
|
|
} |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub _construct_description { |
|
46
|
19
|
|
|
19
|
|
28
|
my $result = shift; |
|
47
|
|
|
|
|
|
|
|
|
48
|
19
|
100
|
100
|
|
|
121
|
$result = "$spec_description\n $result" if $spec_description and (! $context_description); |
|
49
|
19
|
100
|
100
|
|
|
73
|
$result = "$spec_description\n $context_description\n $result" if $spec_description and $context_description; |
|
50
|
|
|
|
|
|
|
|
|
51
|
19
|
|
|
19
|
|
163
|
return sub { colored [_color()], $result }; |
|
|
19
|
|
|
|
|
41
|
|
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _color { |
|
55
|
19
|
100
|
|
19
|
|
181
|
return $passed ? 'green' : 'red'; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
26
|
|
|
26
|
0
|
63
|
sub spec_description { $spec_description = shift; } |
|
59
|
8
|
|
|
8
|
0
|
17
|
sub context_description { $context_description = shift; } |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |