Branch Coverage

lib/File/Valet.pm
Criterion Covered Total %
branch 57 148 38.5


line true false branch
31 0 0 if rename $from, $to
34 0 0 unless ($result)
40 0 0 unless (@st)
46 0 0 unless (utime $atime, $mtime, $to)
51 0 0 unless (unlink $from)
60 0 0 if (not defined $fn or $fn eq "")
64 0 0 if (not defined $dest or $dest eq "")
69 0 0 unless (-d $dest)
72 0 0 unless (-e $dest)
76 0 0 unless (-d _)
80 0 0 unless (-w _)
85 0 0 unless (-e "$dest/$dest_fn")
98 2 116 if (not defined $fn or $fn eq "")
103 27 89 unless (open $fh, "< :raw", $fn)
109 79 10 if ($file_size) { }
111 0 79 if (not defined $n_bytes) { }
0 79 elsif ($n_bytes != $file_size) { }
122 0 10 unless (defined $res)
128 0 89 unless ($res)
139 3 2 if (not defined $fn or $fn eq "")
144 0 2 unless (open $fh, "> :raw", $fn)
150 0 2 unless (defined $res)
155 0 2 unless ($res)
166 2 1602 if (not defined $fn or $fn eq "")
171 0 1602 unless (open $fh, ">> :raw", $fn)
177 0 1602 unless (defined $res)
182 0 1602 unless ($res)
191 0 62 $^O eq 'MSWin32' || $File::Valet::Config{'osname'} =~ /windows/i || $File::Valet::Config{'osname'} =~ /winserver/i || $File::Valet::Config{'osname'} =~ /microsoft/i ? :
196 0 0 if defined $d and -d $d and -w _
203 42 0 if defined $env_home and -d $env_home
206 0 0 if ($is_windows) { }
209 0 0 if (defined $home_path) { }
0 0 elsif (defined $username) { }
215 0 0 if defined $env_home and -d $env_home
218 0 0 if (@row >= 9)
220 0 0 if defined $home_dir and -d $home_dir
222 0 0 if -d "/root" and -w "/root"
234 0 20 if defined $ENV{'TEMPDIR'}
235 0 20 if defined $ENV{'TEMP'}
236 0 20 if defined $ENV{'TMP'}
238 0 20 if ($is_windows)
249 20 0 if defined $home_dir
250 20 0 if defined $ENV{'PWD'}
251 20 0 unless $is_windows
253 0 20 unless -d $d
255 20 0 if -w _
262 0 21 if $Config::Config{'osname'} =~ /MSWin/
265 21 0 if defined $ENV{'PATH'}
266 21 0 if defined $home_dir
270 21 147 if defined $been_there{$d}
273 126 21 unless -x $f
283 0 0 if defined $ENV{'PATH'}
287 0 0 if defined $been_there{$d}
290 0 0 unless -x $f
301 1600 0 unless defined $opt{'nsec'} and int $opt{'nsec'} > 0
302 1600 0 unless defined $opt{'msg'} and $opt{'msg'} ne ""
303 1600 0 unless defined $opt{'limit'} and int $opt{'limit'} > 0
304 1600 0 unless defined $opt{'sleep_duration'} and $opt{'sleep_duration'} > 0
310 0 1600 if ($LOCKS_HASH{$f})
316 109 4 if (-e $lockfile_name)
321 26 83 unless (defined $txt)
322 0 26 if (time - $tm_start > $opt{'limit'})
331 83 0 if ($txt =~ /^\d+\t/)
333 0 83 unless defined $lock_duration
337 0 83 if time > $mtime + $lock_duration or $locking_process_still_lives < 1
341 0 87 if (time - $tm_start > $opt{'limit'})
364 1600 0 if ($LOCKS_HASH{$f})
366 0 1600 if $LOCKS_HASH{$f} > 0
369 0 1600 unless (sysopen $lockfile_fh, $lockfile_name, &O_RDONLY)
373 0 1600 unless (my $result = sysread($lockfile_fh, $dgram, 4095))
374 0 0 if (defined $result) { }
385 0 1600 if (defined $lpid and $lpid ne $$)
403 0 0 unless $LOCKS_HASH{$f}
407 0 0 unless $OK eq "OK"