Branch Coverage

lib/File/Valet.pm
Criterion Covered Total %
branch 57 150 38.0


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 106 if (not defined $fn or $fn eq "")
103 23 83 unless (open $fh, "< :raw", $fn)
109 71 12 if ($file_size) { }
111 0 71 if (not defined $n_bytes) { }
0 71 elsif ($n_bytes != $file_size) { }
122 0 12 unless (defined $res)
128 0 83 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 unless -e $d
206 0 0 if defined $d and -d $d and -w _
213 42 0 if defined $env_home and -d $env_home
216 0 0 if ($is_windows) { }
219 0 0 if (defined $home_path) { }
0 0 elsif (defined $username) { }
225 0 0 if defined $env_home and -d $env_home
228 0 0 if (@row >= 9)
230 0 0 if defined $home_dir and -d $home_dir
232 0 0 if -d "/root" and -w "/root"
244 0 20 if defined $ENV{'TEMPDIR'}
245 0 20 if defined $ENV{'TEMP'}
246 0 20 if defined $ENV{'TMP'}
248 0 20 if ($is_windows)
259 20 0 if defined $home_dir
260 20 0 if defined $ENV{'PWD'}
261 20 0 unless $is_windows
263 0 20 unless -d $d
265 20 0 if -w _
272 0 21 if $Config::Config{'osname'} =~ /MSWin/
275 21 0 if defined $ENV{'PATH'}
276 21 0 if defined $home_dir
280 21 147 if defined $been_there{$d}
283 126 21 unless -x $f
293 0 0 if defined $ENV{'PATH'}
297 0 0 if defined $been_there{$d}
300 0 0 unless -x $f
311 1600 0 unless defined $opt{'nsec'} and int $opt{'nsec'} > 0
312 1600 0 unless defined $opt{'msg'} and $opt{'msg'} ne ""
313 1600 0 unless defined $opt{'limit'} and int $opt{'limit'} > 0
314 1600 0 unless defined $opt{'sleep_duration'} and $opt{'sleep_duration'} > 0
320 0 1600 if ($LOCKS_HASH{$f})
326 99 7 if (-e $lockfile_name)
331 22 77 unless (defined $txt)
332 0 22 if (time - $tm_start > $opt{'limit'})
341 77 0 if ($txt =~ /^\d+\t/)
343 0 77 unless defined $lock_duration
347 0 77 if time > $mtime + $lock_duration or $locking_process_still_lives < 1
351 0 84 if (time - $tm_start > $opt{'limit'})
374 1600 0 if ($LOCKS_HASH{$f})
376 0 1600 if $LOCKS_HASH{$f} > 0
379 0 1600 unless (sysopen $lockfile_fh, $lockfile_name, &O_RDONLY)
383 0 1600 unless (my $result = sysread($lockfile_fh, $dgram, 4095))
384 0 0 if (defined $result) { }
395 0 1600 if (defined $lpid and $lpid ne $$)
413 0 0 unless $LOCKS_HASH{$f}
417 0 0 unless $OK eq "OK"