test/lib/RandomFilePassesPathsToCheckRoutine.pm

filter: Statementstmt 100% 33 / 33 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 1 totaltotal 97.7% 44 / 45 SCAR 11.0
CC
3
Cov
100%
check_routine_gets_paths
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« test/lib/RandomFileRecursiveOption.pm ↑ Summary test/lib/RandomFileWithUnknownParameters.pm »
1 package
2 RandomFilePassesPathsToCheckRoutine;
3 1 ▶use base qw/RandomFileMethodBase/;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use TestConstants;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub check_routine_gets_paths : Test(2) {
12 6 ▶ my $self = shift;
Subroutine check_routine_gets_paths: called CC=3 SCAR=11.0
Pod undocumented
13 6 my @files_shift = ();
14 6 my @files_it = ();
15 6 my %files = ('with shift' => \@files_shift,
16 'with $_' => \@files_it);
17 my %check_routine = (
18 18000 ▶ 'with shift' => sub { push @files_shift, shift() },
Subroutine __ANON__: called CC=1 SCAR=0.0
19 18000 ▶ 'with $_' => sub { push @files_it, $_ }
Subroutine __ANON__: called CC=1 SCAR=0.0
20 6 );
21 6 ▶ while (my ($check_desc, $check_func) = each %check_routine) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %check_routine) 12 6 18
22 12 my @args = (-dir => REC_DIR,
23 -recursive => 1,
24 -check => $check_func);
25 12 my $exp = Set::Scalar->new();
26 12 $exp->insert( $self->random_file(@args) ) for (1 .. SAMPLE_SIZE);
27 12 my $found_files = Set::Scalar->new( @{$files{$check_desc}} );
28
29 12 is $found_files, $exp, "Arguments passed to check $check_desc";
30 }
31 1 ▶}
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33 1 1;
« test/lib/RandomFileRecursiveOption.pm ↑ Summary test/lib/RandomFileWithUnknownParameters.pm »