line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test2::Tools::Exports; |
2
|
157
|
|
|
157
|
|
2044
|
use strict; |
|
157
|
|
|
|
|
324
|
|
|
157
|
|
|
|
|
4432
|
|
3
|
157
|
|
|
157
|
|
762
|
use warnings; |
|
157
|
|
|
|
|
326
|
|
|
157
|
|
|
|
|
6251
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.000155'; |
6
|
|
|
|
|
|
|
|
7
|
157
|
|
|
157
|
|
1170
|
use Carp qw/croak carp/; |
|
157
|
|
|
|
|
327
|
|
|
157
|
|
|
|
|
7591
|
|
8
|
157
|
|
|
157
|
|
913
|
use Test2::API qw/context/; |
|
157
|
|
|
|
|
350
|
|
|
157
|
|
|
|
|
7555
|
|
9
|
157
|
|
|
157
|
|
66613
|
use Test2::Util::Stash qw/get_symbol/; |
|
157
|
|
|
|
|
435
|
|
|
157
|
|
|
|
|
11333
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT = qw/imported_ok not_imported_ok/; |
12
|
157
|
|
|
157
|
|
1161
|
use base 'Exporter'; |
|
157
|
|
|
|
|
367
|
|
|
157
|
|
|
|
|
63593
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub imported_ok { |
15
|
33
|
|
|
33
|
1
|
9891
|
my $ctx = context(); |
16
|
33
|
|
|
|
|
16592
|
my $caller = caller; |
17
|
33
|
|
|
|
|
136
|
my @missing = grep { !get_symbol($_, $caller) } @_; |
|
305
|
|
|
|
|
808
|
|
18
|
|
|
|
|
|
|
|
19
|
33
|
|
|
|
|
174
|
my $name = "Imported symbol"; |
20
|
33
|
100
|
|
|
|
219
|
$name .= "s" if @_ > 1; |
21
|
33
|
|
|
|
|
109
|
$name .= ": "; |
22
|
33
|
|
|
|
|
161
|
my $list = join(", ", @_); |
23
|
33
|
100
|
|
|
|
180
|
substr($list, 37, length($list) - 37, '...') if length($list) > 40; |
24
|
33
|
|
|
|
|
101
|
$name .= $list; |
25
|
|
|
|
|
|
|
|
26
|
33
|
|
|
|
|
255
|
$ctx->ok(!@missing, $name, [map { "'$_' was not imported." } @missing]); |
|
1
|
|
|
|
|
6
|
|
27
|
|
|
|
|
|
|
|
28
|
33
|
|
|
|
|
11606
|
$ctx->release; |
29
|
|
|
|
|
|
|
|
30
|
33
|
|
|
|
|
1315
|
return !@missing; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub not_imported_ok { |
34
|
7
|
|
|
7
|
1
|
393
|
my $ctx = context(); |
35
|
7
|
|
|
|
|
643
|
my $caller = caller; |
36
|
7
|
|
|
|
|
27
|
my @found = grep { get_symbol($_, $caller) } @_; |
|
12
|
|
|
|
|
34
|
|
37
|
|
|
|
|
|
|
|
38
|
7
|
|
|
|
|
17
|
my $name = "Did not imported symbol"; |
39
|
7
|
100
|
|
|
|
23
|
$name .= "s" if @_ > 1; |
40
|
7
|
|
|
|
|
20
|
$name .= ": "; |
41
|
7
|
|
|
|
|
23
|
my $list = join(", ", @_); |
42
|
7
|
100
|
|
|
|
24
|
substr($list, 37, length($list) - 37, '...') if length($list) > 40; |
43
|
7
|
|
|
|
|
15
|
$name .= $list; |
44
|
|
|
|
|
|
|
|
45
|
7
|
|
|
|
|
42
|
$ctx->ok(!@found, $name, [map { "'$_' was imported." } @found]); |
|
1
|
|
|
|
|
7
|
|
46
|
|
|
|
|
|
|
|
47
|
7
|
|
|
|
|
1518
|
$ctx->release; |
48
|
|
|
|
|
|
|
|
49
|
7
|
|
|
|
|
205
|
return !@found; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
1; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
__END__ |