line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::More::Prefix::TB1; |
2
|
|
|
|
|
|
|
$Test::More::Prefix::TB1::VERSION = '0.005'; |
3
|
|
|
|
|
|
|
# Load Test::More::Prefix for early versions of Test::Builder |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
require Exporter; |
6
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
7
|
|
|
|
|
|
|
our @EXPORT_OK = qw(test_prefix); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $prefix = ''; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
0
|
|
|
sub import { __PACKAGE__->export_to_level(2, @_); } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub test_prefix { |
14
|
0
|
|
|
0
|
|
|
$prefix = shift(); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
package Test::More::Prefix::ModifierRole; |
18
|
|
|
|
|
|
|
$Test::More::Prefix::ModifierRole::VERSION = '0.005'; |
19
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
20
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
17
|
|
21
|
1
|
|
|
1
|
|
2391
|
use Moose::Role; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
requires '_print_comment'; |
24
|
|
|
|
|
|
|
requires 'done_testing'; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
around '_print_comment' => sub { |
27
|
|
|
|
|
|
|
my ($orig, $self, $fh, @args) = @_; |
28
|
|
|
|
|
|
|
if ( $prefix && length( $prefix ) ) { |
29
|
|
|
|
|
|
|
@args = map { |
30
|
|
|
|
|
|
|
defined $_ ? "$prefix: $_" : $_ |
31
|
|
|
|
|
|
|
} @args; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
return $self->$orig( $fh, @args ); |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
before 'done_testing' => sub { |
37
|
|
|
|
|
|
|
undef($prefix); |
38
|
|
|
|
|
|
|
}; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# mst told me to do this :-) |
41
|
|
|
|
|
|
|
package |
42
|
|
|
|
|
|
|
Test::Builder; |
43
|
|
|
|
|
|
|
use Moose; |
44
|
|
|
|
|
|
|
with 'Test::More::Prefix::ModifierRole'; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |