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 SCAR 11.0
CC
3
Cov
100%
export_to_level
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« CHI/t/Driver/File.pm ↑ Summary CHI/t/Config.pm »
1 # $Id: $
2 #
3 package CHI::Test;
4 20 $CHI::Test::VERSION = '0.59';
5 20 ▶use Log::Any::Test; # as early as possible
Subroutine BEGIN: called CC=1 SCAR=0.0
6 20 ▶use List::MoreUtils qw(uniq);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 20 ▶use Module::Runtime qw(require_module);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 20 ▶use CHI;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 20 ▶use CHI::Driver::Memory;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 20 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 20 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub import {
14 34 ▶ my $class = shift;
Subroutine import: called CC=1 SCAR=0.0
15 34 $class->export_to_level( 1, undef, @_ );
16 }
17  
18 sub packages_to_import {
19 return (
20 34 ▶ 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 34 ▶ my ( $class, $level, $ignore ) = @_;
Subroutine export_to_level: called CC=3 SCAR=11.0
Pod undocumented
31  
32 34 foreach my $package ( $class->packages_to_import() ) {
33 136 require_module($package);
34 136 my @export;
35 136 ▶ if ( $package eq 'Test::Deep' ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($package eq 'Test::Deep') { } 34 102 136
36  
37 # Test::Deep exports way too much by default
38 34 @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 20 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
45 102 @export = @{"$package\::EXPORT"};
46 }
47 136 $package->export_to_level( $level + 1, undef, @export );
48 }
49 }
50  
51 20 1;
« CHI/t/Driver/File.pm ↑ Summary CHI/t/Config.pm »