CHI/Test.pm

filter: Statementstmt 100% 38 / 38 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 0.0% 0 / 2 totaltotal 96.2% 51 / 53 CC 3 SCAR 3.8
CC
3
Cov
100%
export_to_level
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.5
« CHI/Test/Driver/Role/CheckKeyValidity.pm ↑ Summary CHI/t/Driver/RawMemory.pm »
1 # $Id: $
2 #
3 package CHI::Test;
4 19 $CHI::Test::VERSION = '0.60';
5 19 ▶use Log::Any::Test; # as early as possible
Subroutine BEGIN: called CC=1 SCAR=0.0
6 19 ▶use List::MoreUtils qw(uniq);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 19 ▶use Module::Runtime qw(require_module);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 19 ▶use CHI;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 19 ▶use CHI::Driver::Memory;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 19 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 19 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub import {
14 33 ▶ my $class = shift;
Subroutine import: called CC=1 SCAR=0.0
15 33 $class->export_to_level( 1, undef, @_ );
16 }
17  
18 sub packages_to_import {
19 return (
20 33 ▶ qw(
Subroutine packages_to_import: called CC=1 SCAR=0.0
Pod undocumented
21 Test::Deep
22 Test::More
23 Test::Exception
24 CHI::Test::Util
25 )
26 );
27 }
28  
29 sub export_to_level {
30 33 ▶ my ( $class, $level, $ignore ) = @_;
Subroutine export_to_level: called CC=3 SCAR=11.0
Pod undocumented
31  
32 33 foreach my $package ( $class->packages_to_import() ) {
33 132 require_module($package);
34 132 my @export;
35 132 ▶ if ( $package eq 'Test::Deep' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($package eq 'Test::Deep') { } 33 99 132
36  
37 # Test::Deep exports way too much by default
38 33 @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 19 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
45 99 @export = @{"$package\::EXPORT"};
46 }
47 132 $package->export_to_level( $level + 1, undef, @export );
48 }
49 }
50  
51 19 1;
« CHI/Test/Driver/Role/CheckKeyValidity.pm ↑ Summary CHI/t/Driver/RawMemory.pm »