Branch Coverage

blib/lib/File/Repl.pm
Criterion Covered Total %
branch 144 392 36.7


line true false branch
204 0 10 unless ref $conf eq 'HASH'
220 7 3 defined $conf->{'verbose'} ? :
4 6 defined $conf->{'age'} ? :
0 10 defined $conf->{'ttl'} ? :
0 10 defined $conf->{'nocase'} ? :
0 10 defined $conf->{'bmark'} ? :
0 10 defined $conf->{'recurse'} ? :
1 9 defined $conf->{'mkdirs'} ? :
224 1 9 if ($r_con->{'verbose'} >= 3)
233 0 10 if $r_con->{'bmark'}
234 10 0 if (-d $r_con->{'dira'}) { }
0 0 elsif (not $r_con->{'mkdirs'}) { }
237 10 0 if ($r_con->{'recurse'}) { }
240 90 10 if $tmp
244 0 0 unless opendir DIRA, "$r_con->{'dira'}"
247 0 0 if -d $r_con->{'dira'} . $tmp
256 0 10 if $r_con->{'bmark'}
259 0 10 if $r_con->{'bmark'}
260 1 9 if ($r_con->{'dira'} eq $r_con->{'dirb'}) { }
9 0 elsif (-d $r_con->{'dirb'}) { }
0 0 elsif (not $r_con->{'mkdirs'}) { }
266 9 0 if ($r_con->{'recurse'}) { }
269 50 9 if $tmp
273 0 0 unless opendir DIRB, "$r_con->{'dirb'}"
276 0 0 if -d $r_con->{'dirb'} . $tmp
285 0 10 if $r_con->{'bmark'}
307 0 0 if (scalar @_ eq 3) { }
0 0 elsif (scalar @_ eq 4) { }
320 0 0 if (scalar @_ eq 3) { }
0 0 elsif (scalar @_ eq 4) { }
349 8 1 if ($caller eq 'Update') { }
1 0 elsif ($caller eq 'Delete') { }
0 0 elsif ($caller eq 'Rename') { }
350 8 0 if (scalar @_ == 4) { }
0 0 elsif (scalar @_ == 5) { }
359 0 8 if ($mode eq '')
361 0 0 if $verbose > 1
363 0 8 unless ($mode =~ /^(A>B!?)|(A<>B)|(A]b)|(a<>b)$/)
368 1 0 if (scalar @_ eq 3) { }
0 0 elsif (scalar @_ eq 4) { }
376 0 0 if (scalar @_ eq 4) { }
0 0 elsif (scalar @_ eq 5) { }
386 0 9 unless defined $commit
388 3 6 $r_con->{'agelimit'} ? :
389 0 9 unless $negregex
393 0 9 if ($TZ_BIAS)
394 0 0 if ($r_con->{'dira'} =~ /^([a-z]:)/i or $r_con->{'dira'} =~ m[^([\\/].\w+[\\/][a-z0-9\$]+)]i or Win32::GetCwd() =~ /^([a-z]:)/i)
397 0 0 if FsType(1) =~ /FAT/
399 0 0 if ($r_con->{'dirb'} =~ /^([a-z]:)/i or $r_con->{'dirb'} =~ m[^([\\/].\w+[\\/][a-z0-9\$]+)]i or Win32::GetCwd() =~ /^([a-z]:)/i)
402 0 0 if FsType($1) =~ /FAT/
404 0 0 if $tz_bias_a and $tz_bias_b
406 8 1 if ($caller eq 'Update') { }
1 0 elsif ($caller eq 'Delete') { }
407 1 7 if $verbose >= 3
417 0 1 if $verbose >= 3
426 0 9 if $r_con->{'bmark'}
429 0 9 if $r_con->{'bmark'}
440 10 14 if $verbose > 3
441 24 0 if ($disp eq '-->') { }
0 0 elsif ($disp eq '<--') { }
457 0 24 if ($amtime == 0) { }
22 2 elsif ($bmtime == 0) { }
462 0 2 $bmtime > $amtime ? :
464 20 4 if ($agelimit)
465 20 0 if ($agelimit > 0) { }
466 0 20 if ($runtime - $age > $agelimit)
468 0 0 if $verbose > 1
472 0 0 if ($runtime - $age > -$agelimit)
474 0 0 if $verbose > 1
479 10 14 unless ($commit)
480 10 0 if $verbose >= 1
483 0 14 unless (&$md(dirname($B)))
488 9 5 if (-f $A) { }
489 2 7 if (-f $B)
495 0 2 unless (rename $B, $Btmp)
500 2 7 if (-d $B)
505 9 0 if (copy($A, $B)) { }
506 5 4 if $verbose >= 1
509 9 0 unless $mode & 2
510 0 9 unless utime $Amtime, $Amtime, $B
511 9 0 unless $mode & 2
513 2 7 if ($Btmp)
519 0 0 if ($Btmp)
520 0 0 unless (rename $Btmp, $B)
527 0 5 if (-f $B)
532 0 5 unless (-d $B)
534 0 0 if mkdir $B, 511
535 0 0 if $verbose >= 1
547 0 18 unless $commit
548 5 13 unless (-d $Dir)
551 4 1 unless -d $parent
552 0 5 unless mkdir $Dir, 511
564 0 1 if (-d $targ) { }
1 0 elsif (-f $targ) { }
569 0 1 if ($mtime and $agelimit) { }
570 0 0 if ($agelimit > 0) { }
571 0 0 if ($runtime - $mtime > $agelimit)
572 0 0 if $verbose > 1
576 0 0 if ($runtime - $mtime < -$agelimit)
577 0 0 if $verbose > 1
582 0 1 if $commit eq 0 & $verbose >= 1
584 0 1 unless $commit
586 0 1 if (-d $targ) { }
1 0 elsif (-f $targ) { }
587 0 0 unless rmdir $targ
611 0 0 if $tmp eq $targ
612 0 0 if (&$del($File::Find::name))
618 0 0 if ($top) { }
620 0 0 if (rmdir "$dir$targ") { }
627 0 0 $commit ? :
636 0 0 if $verbose >= 2
637 0 0 if ($commit)
638 0 0 unless chmod 0666, $$file_ref
639 0 0 unless truncate $$file_ref, 0
641 0 0 $commit ? :
651 0 0 if $verbose >= 2
652 0 0 if ($commit)
653 0 0 unless open FILE, ">> $file"
657 0 0 $commit ? :
665 0 0 if (not $commit) { }
0 0 elsif (rename $old, $new) { }
666 0 0 if $verbose > 1
669 0 0 if $verbose > 1
677 0 9 if $r_con->{'bmark'}
678 8 1 if ($caller eq 'Update') { }
1 0 elsif ($caller eq 'Delete') { }
0 0 elsif ($caller eq 'Rename') { }
686 0 0 if (-d $r_con->{'dira'} . $tName)
690 0 0 if (-d $r_con->{'dirb'} . $tName)
696 0 0 if ($r_con->{'nocase'}) { }
700 0 0 $refa->{$name} ? :
701 0 0 $refb->{$name} ? :
703 0 0 if ($aName)
704 0 0 if (-d $r_con->{'dira'} . $aName) { }
708 0 0 if &$del($r_con->{'dira'} . $aName)
711 0 0 if ($bName)
712 0 0 if (-d $r_con->{'dirb'} . $bName) { }
716 0 0 if &$del($r_con->{'dirb'} . $bName)
725 0 0 $refa->{$_} ? :
726 0 0 $refb->{$_} ? :
727 0 0 if $afile and -s $afile
728 0 0 if $bfile and -s $bfile
729 0 0 if $afile and $refa->{$_} + $ttl < $runtime and &$del($afile)
730 0 0 if $bfile and $refb->{$_} + $ttl < $runtime and &$del($bfile)
734 3 5 if ($mode =~ /^(A>B!?)|(A<>B)$/)
736 0 20 unless exists $refa->{$_}
742 15 5 if &$fc($afile, $bfile, $amtime, 0, '-->', $atype)
745 0 8 if ($mode =~ /^(AB)$/)
747 0 0 unless exists $refb->{$_}
753 0 0 if &$fc($afile, $bfile, 0, $bmtime, '<--', $btype)
756 0 8 if ($mode =~ /^A
758 0 0 unless exists $refa->{$_}
761 0 0 if &$del($afile, $amtime)
764 0 8 if ($mode =~ /^A>B!$/)
766 0 0 unless exists $refb->{$_}
769 0 0 if &$del($bfile, $bmtime)
776 0 50 unless exists $refa->{$aName}
790 2 48 if ($btype & 1 & !($atype & 1) & $mode =~ /^(a>b)|(a<>b)|(A>B)|(A>B!)$/)
793 2 0 if &$fc($afile, $bfile, $amtime, 0, '-->', $atype)
800 0 50 if ($atype & 1 & !($btype & 1) & $mode =~ /^(ab)|(A
803 0 0 if &$fc($afile, $bfile, $amtime, $bmtime, '<--', $btype)
808 0 50 if (($atype & 1) != ($btype & 1) & $mode =~ /^(A<>B)$/)
817 25 25 if -d $afile
819 2 23 if ($amtime > $bmtime + $fudge) { }
2 21 elsif ($amtime + $fudge < $bmtime) { }
821 2 0 if ($mode =~ /^(a>b)|(a<>b)|(A>B)|(A>B!)|(A<>B)$/)
826 2 0 if &$fc($afile, $bfile, $amtime, $bmtime, '-->', $atype)
830 0 2 if ($mode =~ /^(ab)|(AB)$/)
835 0 0 if &$fc($afile, $bfile, $amtime, $bmtime, '<--', $btype)
841 0 1 unless exists $refa->{$f}
845 1 0 if (&$del($afile, $amtime))
846 1 0 if ($commit)
857 0 0 if ($nsub =~ /^$sep(.*)$sep(.*)$sep(.*)?$/) { }
862 0 0 unless exists $refa->{$f}
865 0 0 if $newname eq $f
868 0 0 if (&$mv($afile, $Afile))
887 0 9 if $r_con->{'bmark'}
906 9 0 $nocase ? :
909 1 8 if $r_con->{'verbose'} >= 4
911 81 9 if ($name and $name =~ /$regexextn$regex/ and not $name =~ /$regexextn$negregex/)
917 1 8 if $r_con->{'verbose'} >= 4
919 51 9 if ($name and $name =~ /$regexextn$regex/ and not $name =~ /$regexextn$negregex/)
939 9 0 $nocase ? :
940 9 0 $nocase ? :
943 3 51 unless defined $sorted_bmatch[$bIndex]
946 51 0 if ($aName eq $bName or $nocase and lc $aName eq lc $bName) { }
0 0 elsif ($nocase and lc $aName lt lc $bName or not $nocase and $aName lt $bName) { }
970 1 8 if ($r_con->{'verbose'} >= 3)
994 0 0 $r1 ? :
0 0 if $str eq 'init'
995 0 0 unless $r1
1011 2 0 if (-d $_)
1016 0 2 if (-f $_)
1017 0 0 if not unlink($File::Find::name)
1024 0 1 unless rmdir $dir
1026 1 1 if not rmdir $root