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   9 use base qw/RandomFileMethodBase/;
  1         2  
  1         66  
4 1     1   7 use TestConstants;
  1         1  
  1         64  
5              
6 1     1   6 use Data::Dumper;
  1         1  
  1         41  
7              
8 1     1   5 use constant REC_ON_ARGS => (1, "on", "true", 9);
  1         12  
  1         64  
9 1     1   6 use constant REC_OFF_ARGS => (0, undef, "0", '');
  1         2  
  1         195  
10              
11             sub recursive_tests : Test(10) {
12 6     6 0 5172 my $self = shift;
13 6         85 $self->_did_i_found([REC_FILES], -recursive => $_) for REC_ON_ARGS();
14              
15 6         4260 chdir REC_DIR;
16 6         79 $self->_did_i_found([REC_FILES], -dir => '.', -recursive => 1);
17 6         4599 chdir HOME_DIR;
18              
19 6         100 $self->_did_i_found([REC_ODD_FILES], -recursive => 1,
20             -check => qr/[13579]$/);
21              
22 6         3821 $self->_did_i_found([REC_TOP_FILES], -recursive => $_) for REC_OFF_ARGS();
23 1     1   8 }
  1         2  
  1         15  
24              
25             sub _did_i_found {
26 60     60   24334 my ($self, $exp, @params) = @_;
27 60         266 @params = (-dir => REC_DIR, @params);
28 60         503 $self->expected_files_found_ok( $exp, [@params], "Args: ".Dumper(\@params) );
29             }
30              
31             1;