line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Plugin::TermEncoding; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1034
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.000002'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
353
|
use Term::Encoding; |
|
1
|
|
|
|
|
445
|
|
|
1
|
|
|
|
|
40
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
|
|
182
|
use Test2::API qw{ |
11
|
|
|
|
|
|
|
test2_add_callback_post_load |
12
|
|
|
|
|
|
|
test2_stack |
13
|
1
|
|
|
1
|
|
496
|
}; |
|
1
|
|
|
|
|
28444
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub import { |
16
|
1
|
|
|
1
|
|
8
|
my $class = shift; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Should it be explicitly specified by the test script? |
19
|
1
|
|
|
|
|
527
|
require utf8; |
20
|
1
|
|
|
|
|
10
|
utf8->import; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
test2_add_callback_post_load(sub { |
23
|
1
|
|
|
1
|
|
189
|
my $stack = test2_stack; |
24
|
1
|
|
|
|
|
14
|
$stack->top; |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
3399
|
my $warned = 0; |
27
|
1
|
|
|
|
|
4
|
for my $hub ($stack->all) { |
28
|
1
|
|
50
|
|
|
6
|
my $format = $hub->format || next; |
29
|
|
|
|
|
|
|
|
30
|
1
|
50
|
|
|
|
9
|
unless ($format->can('encoding')) { |
31
|
0
|
0
|
|
|
|
0
|
warn "Could not apply encoding to unknown formatter ($format)\n" unless $warned++; |
32
|
0
|
|
|
|
|
0
|
next; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
1
|
50
|
|
|
|
3
|
my $encoding = (-t STDOUT) ? Term::Encoding::get_encoding() : "UTF8"; |
36
|
1
|
|
|
|
|
3
|
$format->encoding($encoding); |
37
|
|
|
|
|
|
|
} |
38
|
1
|
|
|
|
|
8
|
}); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |