line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::WRT::Mock::FileIO; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# Partially mock FileIO (the write operations - reads are still done as |
4
|
|
|
|
|
|
|
# usual). |
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
94710
|
use strict; |
|
2
|
|
|
|
|
12
|
|
|
2
|
|
|
|
|
54
|
|
7
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
45
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
9
|
use Carp; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
95
|
|
10
|
2
|
|
|
2
|
|
305
|
use App::WRT::Util; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
469
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
2
|
|
|
2
|
0
|
563
|
my $class = shift; |
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
|
|
20
|
my %params = ( |
16
|
|
|
|
|
|
|
'io' => App::WRT::FileIO->new(), |
17
|
|
|
|
|
|
|
'file_contents' => { }, |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
|
|
6
|
my $self = \%params; |
21
|
2
|
|
|
|
|
12
|
bless $self, $class; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub dir_list { |
25
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
26
|
0
|
|
|
|
|
0
|
return $self->{io}->dir_list(@_); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub file_put_contents { |
30
|
60
|
|
|
60
|
0
|
68
|
my $self = shift; |
31
|
60
|
|
|
|
|
81
|
my ($file, $contents) = @_; |
32
|
60
|
|
|
|
|
188
|
$self->{file_contents}->{$file} = $contents; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub file_get_contents { |
36
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
37
|
0
|
|
|
|
|
0
|
return $self->{io}->file_get_contents(@_); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub file_copy { |
41
|
20
|
|
|
20
|
0
|
118
|
my ($self, $source, $dest) = @_; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub dir_make { |
45
|
72
|
|
|
72
|
0
|
95
|
my ($self, $path) = @_; |
46
|
72
|
|
|
|
|
72
|
my $path_err; |
47
|
72
|
|
|
|
|
99
|
return 1; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |