line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package RandomFileSimpleDirOption; |
2
|
1
|
|
|
1
|
|
8
|
use base qw/RandomFileMethodBase/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
373
|
|
3
|
1
|
|
|
1
|
|
8
|
use TestConstants; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
171
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
20
|
|
|
1
|
|
|
|
|
26
|
|
6
|
1
|
|
|
1
|
|
6
|
use Test::More; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
7
|
1
|
|
|
1
|
|
234
|
use Test::Exception; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
8
|
1
|
|
|
1
|
|
221
|
use Data::Dumper; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
122
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
|
|
12
|
use constant SIMPLE_DIR_ARGS => ([-path => SIMPLE_DIR, -home => HOME_DIR], |
11
|
|
|
|
|
|
|
[-dir => no_slash( SIMPLE_DIR)], |
12
|
1
|
|
|
1
|
|
7
|
[-dir => with_slash (SIMPLE_DIR)]); |
|
1
|
|
|
|
|
1
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
6
|
use constant EMPTY_DIR_ARGS => ([-path => EMPTY_DIR, -home => HOME_DIR], |
15
|
|
|
|
|
|
|
[-dir => no_slash (EMPTY_DIR)], |
16
|
1
|
|
|
1
|
|
6
|
[-dir => with_slash (EMPTY_DIR)]); |
|
1
|
|
|
|
|
2
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
97
|
use constant WRONG_DIR_PARAMS => ("/foo/bar/nonsens/reallynonsens/", |
19
|
1
|
|
|
1
|
|
7
|
undef, '', 0, [], {}); |
|
1
|
|
|
|
|
2
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub create_empty_subdir : Test(setup) { |
22
|
54
|
|
|
54
|
0
|
95422
|
mkdir EMPTY_DIR; |
23
|
1
|
|
|
1
|
|
6
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub dir_option_with_a_simple_dir : Test(3) { |
26
|
6
|
|
|
6
|
0
|
4277
|
my $self = shift; |
27
|
6
|
|
|
|
|
27
|
foreach (SIMPLE_DIR_ARGS) { |
28
|
18
|
|
|
|
|
7682
|
$self->expected_files_found_ok([ SIMPLE_FILES ], |
29
|
|
|
|
|
|
|
$_, |
30
|
|
|
|
|
|
|
"Simple Dir: Args ". join " ", @$_); |
31
|
|
|
|
|
|
|
} |
32
|
1
|
|
|
1
|
|
662
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub dir_option_for_an_empty_dir : Test(3) { |
35
|
6
|
|
|
6
|
0
|
4217
|
my $self = shift; |
36
|
6
|
|
|
|
|
25
|
foreach (EMPTY_DIR_ARGS) { |
37
|
18
|
|
|
|
|
5835
|
$self->expected_files_found_ok([], |
38
|
|
|
|
|
|
|
$_, |
39
|
|
|
|
|
|
|
"Empty Dir: Argumente " . join " ", @$_); |
40
|
|
|
|
|
|
|
} |
41
|
1
|
|
|
1
|
|
334
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub samples_arent_same : Test(1) { |
44
|
6
|
|
|
6
|
0
|
4264
|
my ($self) = @_; |
45
|
6
|
|
|
|
|
26
|
my @arg = (-dir => SIMPLE_DIR); |
46
|
6
|
|
|
|
|
27
|
ok( ! eq_array( [$self->sample(@arg)], [$self->sample(@arg)] ), |
47
|
|
|
|
|
|
|
"samples are different" ); |
48
|
1
|
|
|
1
|
|
302
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
13
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub wrong_dir_parameters : Test(6) { |
51
|
6
|
|
|
6
|
0
|
4097
|
my ($self) = @_; |
52
|
6
|
|
|
|
|
25
|
foreach my $wrong_dir ( WRONG_DIR_PARAMS() ) { |
53
|
36
|
|
|
36
|
|
2742
|
dies_ok( sub {$self->random_file(-dir => $wrong_dir)}, |
54
|
36
|
|
|
|
|
9882
|
"-dir " . Dumper($wrong_dir) ); |
55
|
|
|
|
|
|
|
} |
56
|
1
|
|
|
1
|
|
319
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |