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 RandomFileRecursiveOption;
2 1     1   8 use base qw/RandomFileMethodBase/;
  1         2  
  1         65  
3 1     1   5 use TestConstants;
  1         2  
  1         63  
4              
5 1     1   7 use Data::Dumper;
  1         1  
  1         57  
6              
7 1     1   8 use constant REC_ON_ARGS => (1, "on", "true", 9);
  1         2  
  1         70  
8 1     1   6 use constant REC_OFF_ARGS => (0, undef, "0", '');
  1         2  
  1         202  
9              
10             sub recursive_tests : Test(10) {
11 6     6 0 4583 my $self = shift;
12 6         71 $self->_did_i_found([REC_FILES], -recursive => $_) for REC_ON_ARGS();
13              
14 6         4227 chdir REC_DIR;
15 6         69 $self->_did_i_found([REC_FILES], -dir => '.', -recursive => 1);
16 6         4161 chdir HOME_DIR;
17              
18 6         99 $self->_did_i_found([REC_ODD_FILES], -recursive => 1,
19             -check => qr/[13579]$/);
20              
21 6         3934 $self->_did_i_found([REC_TOP_FILES], -recursive => $_) for REC_OFF_ARGS();
22 1     1   7 }
  1         1  
  1         13  
23              
24             sub _did_i_found {
25 60     60   23283 my ($self, $exp, @params) = @_;
26 60         239 @params = (-dir => REC_DIR, @params);
27 60         529 $self->expected_files_found_ok( $exp, [@params], "Args: ".Dumper(\@params) );
28             }
29              
30             1;