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