line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Tools::Exports; |
2
|
157
|
|
|
157
|
|
2110
|
use strict; |
|
157
|
|
|
|
|
354
|
|
|
157
|
|
|
|
|
4656
|
|
3
|
157
|
|
|
157
|
|
811
|
use warnings; |
|
157
|
|
|
|
|
395
|
|
|
157
|
|
|
|
|
6379
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000156'; |
6
|
|
|
|
|
|
|
|
7
|
157
|
|
|
157
|
|
925
|
use Carp qw/croak carp/; |
|
157
|
|
|
|
|
364
|
|
|
157
|
|
|
|
|
7680
|
|
8
|
157
|
|
|
157
|
|
978
|
use Test2::API qw/context/; |
|
157
|
|
|
|
|
360
|
|
|
157
|
|
|
|
|
7424
|
|
9
|
157
|
|
|
157
|
|
69419
|
use Test2::Util::Stash qw/get_symbol/; |
|
157
|
|
|
|
|
421
|
|
|
157
|
|
|
|
|
11478
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT = qw/imported_ok not_imported_ok/; |
12
|
157
|
|
|
157
|
|
1101
|
use base 'Exporter'; |
|
157
|
|
|
|
|
360
|
|
|
157
|
|
|
|
|
66293
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub imported_ok { |
15
|
33
|
|
|
33
|
1
|
10458
|
my $ctx = context(); |
16
|
33
|
|
|
|
|
17021
|
my $caller = caller; |
17
|
33
|
|
|
|
|
136
|
my @missing = grep { !get_symbol($_, $caller) } @_; |
|
305
|
|
|
|
|
1129
|
|
18
|
|
|
|
|
|
|
|
19
|
33
|
|
|
|
|
144
|
my $name = "Imported symbol"; |
20
|
33
|
100
|
|
|
|
209
|
$name .= "s" if @_ > 1; |
21
|
33
|
|
|
|
|
97
|
$name .= ": "; |
22
|
33
|
|
|
|
|
148
|
my $list = join(", ", @_); |
23
|
33
|
100
|
|
|
|
237
|
substr($list, 37, length($list) - 37, '...') if length($list) > 40; |
24
|
33
|
|
|
|
|
97
|
$name .= $list; |
25
|
|
|
|
|
|
|
|
26
|
33
|
|
|
|
|
250
|
$ctx->ok(!@missing, $name, [map { "'$_' was not imported." } @missing]); |
|
1
|
|
|
|
|
7
|
|
27
|
|
|
|
|
|
|
|
28
|
33
|
|
|
|
|
10986
|
$ctx->release; |
29
|
|
|
|
|
|
|
|
30
|
33
|
|
|
|
|
1349
|
return !@missing; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub not_imported_ok { |
34
|
7
|
|
|
7
|
1
|
385
|
my $ctx = context(); |
35
|
7
|
|
|
|
|
677
|
my $caller = caller; |
36
|
7
|
|
|
|
|
24
|
my @found = grep { get_symbol($_, $caller) } @_; |
|
12
|
|
|
|
|
35
|
|
37
|
|
|
|
|
|
|
|
38
|
7
|
|
|
|
|
18
|
my $name = "Did not imported symbol"; |
39
|
7
|
100
|
|
|
|
26
|
$name .= "s" if @_ > 1; |
40
|
7
|
|
|
|
|
19
|
$name .= ": "; |
41
|
7
|
|
|
|
|
20
|
my $list = join(", ", @_); |
42
|
7
|
100
|
|
|
|
21
|
substr($list, 37, length($list) - 37, '...') if length($list) > 40; |
43
|
7
|
|
|
|
|
14
|
$name .= $list; |
44
|
|
|
|
|
|
|
|
45
|
7
|
|
|
|
|
72
|
$ctx->ok(!@found, $name, [map { "'$_' was imported." } @found]); |
|
1
|
|
|
|
|
6
|
|
46
|
|
|
|
|
|
|
|
47
|
7
|
|
|
|
|
1492
|
$ctx->release; |
48
|
|
|
|
|
|
|
|
49
|
7
|
|
|
|
|
204
|
return !@found; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |