line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Tools::Exports; |
2
|
156
|
|
|
156
|
|
1962
|
use strict; |
|
156
|
|
|
|
|
294
|
|
|
156
|
|
|
|
|
4219
|
|
3
|
156
|
|
|
156
|
|
732
|
use warnings; |
|
156
|
|
|
|
|
271
|
|
|
156
|
|
|
|
|
5942
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000153'; |
6
|
|
|
|
|
|
|
|
7
|
156
|
|
|
156
|
|
808
|
use Carp qw/croak carp/; |
|
156
|
|
|
|
|
335
|
|
|
156
|
|
|
|
|
9782
|
|
8
|
156
|
|
|
156
|
|
876
|
use Test2::API qw/context/; |
|
156
|
|
|
|
|
379
|
|
|
156
|
|
|
|
|
12301
|
|
9
|
156
|
|
|
156
|
|
62623
|
use Test2::Util::Stash qw/get_symbol/; |
|
156
|
|
|
|
|
392
|
|
|
156
|
|
|
|
|
10655
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT = qw/imported_ok not_imported_ok/; |
12
|
156
|
|
|
156
|
|
1059
|
use base 'Exporter'; |
|
156
|
|
|
|
|
352
|
|
|
156
|
|
|
|
|
59720
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub imported_ok { |
15
|
33
|
|
|
33
|
1
|
8404
|
my $ctx = context(); |
16
|
33
|
|
|
|
|
15738
|
my $caller = caller; |
17
|
33
|
|
|
|
|
111
|
my @missing = grep { !get_symbol($_, $caller) } @_; |
|
305
|
|
|
|
|
677
|
|
18
|
|
|
|
|
|
|
|
19
|
33
|
|
|
|
|
125
|
my $name = "Imported symbol"; |
20
|
33
|
100
|
|
|
|
178
|
$name .= "s" if @_ > 1; |
21
|
33
|
|
|
|
|
112
|
$name .= ": "; |
22
|
33
|
|
|
|
|
138
|
my $list = join(", ", @_); |
23
|
33
|
100
|
|
|
|
167
|
substr($list, 37, length($list) - 37, '...') if length($list) > 40; |
24
|
33
|
|
|
|
|
126
|
$name .= $list; |
25
|
|
|
|
|
|
|
|
26
|
33
|
|
|
|
|
233
|
$ctx->ok(!@missing, $name, [map { "'$_' was not imported." } @missing]); |
|
1
|
|
|
|
|
6
|
|
27
|
|
|
|
|
|
|
|
28
|
33
|
|
|
|
|
16428
|
$ctx->release; |
29
|
|
|
|
|
|
|
|
30
|
33
|
|
|
|
|
1221
|
return !@missing; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub not_imported_ok { |
34
|
7
|
|
|
7
|
1
|
327
|
my $ctx = context(); |
35
|
7
|
|
|
|
|
621
|
my $caller = caller; |
36
|
7
|
|
|
|
|
17
|
my @found = grep { get_symbol($_, $caller) } @_; |
|
12
|
|
|
|
|
32
|
|
37
|
|
|
|
|
|
|
|
38
|
7
|
|
|
|
|
30
|
my $name = "Did not imported symbol"; |
39
|
7
|
100
|
|
|
|
30
|
$name .= "s" if @_ > 1; |
40
|
7
|
|
|
|
|
17
|
$name .= ": "; |
41
|
7
|
|
|
|
|
22
|
my $list = join(", ", @_); |
42
|
7
|
100
|
|
|
|
22
|
substr($list, 37, length($list) - 37, '...') if length($list) > 40; |
43
|
7
|
|
|
|
|
18
|
$name .= $list; |
44
|
|
|
|
|
|
|
|
45
|
7
|
|
|
|
|
36
|
$ctx->ok(!@found, $name, [map { "'$_' was imported." } @found]); |
|
1
|
|
|
|
|
5
|
|
46
|
|
|
|
|
|
|
|
47
|
7
|
|
|
|
|
1941
|
$ctx->release; |
48
|
|
|
|
|
|
|
|
49
|
7
|
|
|
|
|
229
|
return !@found; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |