File Coverage

test/lib/RandomFileRecursiveOption.pm
Criterion Covered Total %
statement 28 28 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod 0 1 0.0
total 36 37 97.3


line stmt bran cond sub pod time code
1             package
2             RandomFileRecursiveOption;
3 1     1   8 use base qw/RandomFileMethodBase/;
  1         3  
  1         105  
4 1     1   7 use TestConstants;
  1         2  
  1         90  
5              
6 1     1   6 use Data::Dumper;
  1         3  
  1         81  
7              
8 1     1   7 use constant REC_ON_ARGS => (1, "on", "true", 9);
  1         2  
  1         71  
9 1     1   6 use constant REC_OFF_ARGS => (0, undef, "0", '');
  1         2  
  1         368  
10              
11             sub recursive_tests : Test(10) {
12 6     6 0 4479 my $self = shift;
13 6         71 $self->_did_i_found([REC_FILES], -recursive => $_) for REC_ON_ARGS();
14              
15 6         4336 chdir REC_DIR;
16 6         73 $self->_did_i_found([REC_FILES], -dir => '.', -recursive => 1);
17 6         4376 chdir HOME_DIR;
18              
19 6         104 $self->_did_i_found([REC_ODD_FILES], -recursive => 1,
20             -check => qr/[13579]$/);
21              
22 6         3679 $self->_did_i_found([REC_TOP_FILES], -recursive => $_) for REC_OFF_ARGS();
23 1     1   8 }
  1         3  
  1         5  
24              
25             sub _did_i_found {
26 60     60   23172 my ($self, $exp, @params) = @_;
27 60         298 @params = (-dir => REC_DIR, @params);
28 60         494 $self->expected_files_found_ok( $exp, [@params], "Args: ".Dumper(\@params) );
29             }
30              
31             1;