line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: $ |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
package CHI::Test; |
4
|
|
|
|
|
|
|
$CHI::Test::VERSION = '0.59'; |
5
|
20
|
|
|
20
|
|
10386
|
use Log::Any::Test; # as early as possible |
|
20
|
|
|
|
|
501633
|
|
|
20
|
|
|
|
|
712
|
|
6
|
20
|
|
|
20
|
|
22633
|
use List::MoreUtils qw(uniq); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use Module::Runtime qw(require_module); |
8
|
|
|
|
|
|
|
use CHI; |
9
|
|
|
|
|
|
|
use CHI::Driver::Memory; |
10
|
|
|
|
|
|
|
use strict; |
11
|
|
|
|
|
|
|
use warnings; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub import { |
14
|
|
|
|
|
|
|
my $class = shift; |
15
|
|
|
|
|
|
|
$class->export_to_level( 1, undef, @_ ); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub packages_to_import { |
19
|
|
|
|
|
|
|
return ( |
20
|
|
|
|
|
|
|
qw( |
21
|
|
|
|
|
|
|
Test::Deep |
22
|
|
|
|
|
|
|
Test::More |
23
|
|
|
|
|
|
|
Test::Exception |
24
|
|
|
|
|
|
|
CHI::Test::Util |
25
|
|
|
|
|
|
|
) |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub export_to_level { |
30
|
|
|
|
|
|
|
my ( $class, $level, $ignore ) = @_; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
foreach my $package ( $class->packages_to_import() ) { |
33
|
|
|
|
|
|
|
require_module($package); |
34
|
|
|
|
|
|
|
my @export; |
35
|
|
|
|
|
|
|
if ( $package eq 'Test::Deep' ) { |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Test::Deep exports way too much by default |
38
|
|
|
|
|
|
|
@export = |
39
|
|
|
|
|
|
|
qw(eq_deeply cmp_deeply cmp_set cmp_bag cmp_methods subbagof superbagof subsetof supersetof superhashof subhashof); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
else { |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# Otherwise, grab everything from @EXPORT |
44
|
|
|
|
|
|
|
no strict 'refs'; |
45
|
|
|
|
|
|
|
@export = @{"$package\::EXPORT"}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
$package->export_to_level( $level + 1, undef, @export ); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |