Branch Coverage

blib/lib/File/Repl.pm
Criterion Covered Total %
branch 107 368 29.0


line true false branch
200 0 6 unless ref $conf eq 'HASH'
216 5 1 defined $conf->{'verbose'} ? :
4 2 defined $conf->{'age'} ? :
0 6 defined $conf->{'ttl'} ? :
0 6 defined $conf->{'nocase'} ? :
0 6 defined $conf->{'bmark'} ? :
0 6 defined $conf->{'recurse'} ? :
1 5 defined $conf->{'mkdirs'} ? :
220 1 5 if ($r_con->{'verbose'} >= 3)
229 0 6 if $r_con->{'bmark'}
230 6 0 if (-d $r_con->{'dira'}) { }
0 0 elsif (not $r_con->{'mkdirs'}) { }
233 6 0 if ($r_con->{'recurse'}) { }
236 50 6 if $tmp
240 0 0 unless opendir DIRA, "$r_con->{'dira'}"
243 0 0 if -d $r_con->{'dira'} . $tmp
252 0 6 if $r_con->{'bmark'}
255 0 6 if $r_con->{'bmark'}
256 0 6 if ($r_con->{'dira'} eq $r_con->{'dirb'}) { }
6 0 elsif (-d $r_con->{'dirb'}) { }
0 0 elsif (not $r_con->{'mkdirs'}) { }
262 6 0 if ($r_con->{'recurse'}) { }
265 20 6 if $tmp
269 0 0 unless opendir DIRB, "$r_con->{'dirb'}"
272 0 0 if -d $r_con->{'dirb'} . $tmp
281 0 6 if $r_con->{'bmark'}
303 0 0 if (scalar @_ eq 3) { }
0 0 elsif (scalar @_ eq 4) { }
316 0 0 if (scalar @_ eq 3) { }
0 0 elsif (scalar @_ eq 4) { }
345 5 0 if ($caller eq 'Update') { }
0 0 elsif ($caller eq 'Delete') { }
0 0 elsif ($caller eq 'Rename') { }
346 5 0 if (scalar @_ == 4) { }
0 0 elsif (scalar @_ == 5) { }
355 0 5 if ($mode eq '')
357 0 0 if $verbose > 1
359 0 5 unless ($mode =~ /^(A>B!?)|(A<>B)|(A]b)|(a<>b)$/)
364 0 0 if (scalar @_ eq 3) { }
0 0 elsif (scalar @_ eq 4) { }
372 0 0 if (scalar @_ eq 4) { }
0 0 elsif (scalar @_ eq 5) { }
382 0 5 unless defined $commit
384 3 2 $r_con->{'agelimit'} ? :
385 0 5 unless $negregex
389 0 5 if ($TZ_BIAS)
390 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)
393 0 0 if FsType(1) =~ /FAT/
395 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)
398 0 0 if FsType($1) =~ /FAT/
400 0 0 if $tz_bias_a and $tz_bias_b
402 5 0 if ($caller eq 'Update') { }
0 0 elsif ($caller eq 'Delete') { }
403 1 4 if $verbose >= 3
413 0 0 if $verbose >= 3
422 0 5 if $r_con->{'bmark'}
425 0 5 if $r_con->{'bmark'}
436 10 11 if $verbose > 3
437 21 0 if ($disp eq '-->') { }
0 0 elsif ($disp eq '<--') { }
452 0 21 if ($amtime == 0) { }
20 1 elsif ($bmtime == 0) { }
457 0 1 $bmtime > $amtime ? :
459 20 1 if ($agelimit)
460 20 0 if ($agelimit > 0) { }
461 0 20 if ($runtime - $age > $agelimit)
463 0 0 if $verbose > 1
467 0 0 if ($runtime - $age > -$agelimit)
469 0 0 if $verbose > 1
474 10 11 unless ($commit)
475 10 0 if $verbose >= 1
478 0 11 unless &$md(dirname($B))
479 6 5 if (-f $A) { }
480 0 6 if (-f $B)
486 0 0 unless (rename $B, $Btmp)
492 6 0 if (copy($A, $B)) { }
493 5 1 if $verbose >= 1
496 6 0 unless $mode & 2
497 0 6 unless utime $Amtime, $Amtime, $B
498 6 0 unless $mode & 2
500 0 6 if ($Btmp)
506 0 0 if ($Btmp)
507 0 0 unless (rename $Btmp, $B)
514 0 5 unless (-d $B)
515 0 0 if mkdir $B, 511
516 0 0 if $verbose >= 1
528 0 15 unless $commit
529 5 10 unless (-d $Dir)
532 4 1 unless -d $parent
533 0 5 unless mkdir $Dir, 511
545 0 0 if (-d $targ) { }
0 0 elsif (-f $targ) { }
550 0 0 if ($mtime and $agelimit) { }
551 0 0 if ($agelimit > 0) { }
552 0 0 if ($runtime - $mtime > $agelimit)
553 0 0 if $verbose > 1
557 0 0 if ($runtime - $mtime < -$agelimit)
558 0 0 if $verbose > 1
563 0 0 if $commit eq 0 & $verbose >= 1
565 0 0 unless $commit
567 0 0 if (-d $targ) { }
0 0 elsif (-f $targ) { }
568 0 0 unless rmdir $targ
586 0 0 if $tmp eq $targ
587 0 0 if (&$del($File::Find::name))
593 0 0 if ($top) { }
595 0 0 if (rmdir "$dir$targ") { }
602 0 0 $commit ? :
611 0 0 if $verbose >= 2
612 0 0 if ($commit)
613 0 0 unless chmod 0666, $$file_ref
614 0 0 unless truncate $$file_ref, 0
616 0 0 $commit ? :
626 0 0 if $verbose >= 2
627 0 0 if ($commit)
628 0 0 unless open FILE, ">> $file"
632 0 0 $commit ? :
640 0 0 if (not $commit) { }
0 0 elsif (rename $old, $new) { }
641 0 0 if $verbose > 1
644 0 0 if $verbose > 1
652 0 5 if $r_con->{'bmark'}
653 5 0 if ($caller eq 'Update') { }
0 0 elsif ($caller eq 'Delete') { }
0 0 elsif ($caller eq 'Rename') { }
661 0 0 if (-d $r_con->{'dira'} . $tName)
665 0 0 if (-d $r_con->{'dirb'} . $tName)
671 0 0 if ($r_con->{'nocase'}) { }
675 0 0 $refa->{$name} ? :
676 0 0 $refb->{$name} ? :
678 0 0 if ($aName)
679 0 0 if (-d $r_con->{'dira'} . $aName) { }
683 0 0 if &$del($r_con->{'dira'} . $aName)
686 0 0 if ($bName)
687 0 0 if (-d $r_con->{'dirb'} . $bName) { }
691 0 0 if &$del($r_con->{'dirb'} . $bName)
700 0 0 $refa->{$_} ? :
701 0 0 $refb->{$_} ? :
702 0 0 if $afile and -s $afile
703 0 0 if $bfile and -s $bfile
704 0 0 if $afile and $refa->{$_} + $ttl < $runtime and &$del($afile)
705 0 0 if $bfile and $refb->{$_} + $ttl < $runtime and &$del($bfile)
709 2 3 if ($mode =~ /^(A>B!?)|(A<>B)$/)
711 0 20 unless exists $refa->{$_}
717 15 5 if &$fc($afile, $bfile, $amtime, 0, '-->', $atype)
720 0 5 if ($mode =~ /^(AB)$/)
722 0 0 unless exists $refb->{$_}
728 0 0 if &$fc($afile, $bfile, 0, $bmtime, '<--', $btype)
731 0 5 if ($mode =~ /^A
733 0 0 unless exists $refa->{$_}
736 0 0 if &$del($afile, $amtime)
739 0 5 if ($mode =~ /^A>B!$/)
741 0 0 unless exists $refb->{$_}
744 0 0 if &$del($bfile, $bmtime)
751 0 20 unless exists $refa->{$aName}
764 10 10 if -d $afile
766 1 9 if ($amtime > $bmtime + $fudge) { }
1 8 elsif ($amtime + $fudge < $bmtime) { }
768 1 0 if ($mode =~ /^(a>b)|(a<>b)|(A>B)|(A>B!)|(A<>B)$/)
773 1 0 if &$fc($afile, $bfile, $amtime, $bmtime, '-->', $atype)
777 0 1 if ($mode =~ /^(ab)|(AB)$/)
782 0 0 if &$fc($afile, $bfile, $amtime, $bmtime, '<--', $btype)
788 0 0 unless exists $refa->{$f}
792 0 0 if (&$del($afile, $amtime))
793 0 0 if ($commit)
804 0 0 if ($nsub =~ /^$sep(.*)$sep(.*)$sep(.*)?$/) { }
809 0 0 unless exists $refa->{$f}
812 0 0 if $newname eq $f
815 0 0 if (&$mv($afile, $Afile))
834 0 5 if $r_con->{'bmark'}
853 5 0 $nocase ? :
856 1 4 if $r_con->{'verbose'} >= 4
858 50 0 if ($name and $name =~ /$regexextn$regex/ and not $name =~ /$regexextn$negregex/)
864 1 4 if $r_con->{'verbose'} >= 4
866 20 0 if ($name and $name =~ /$regexextn$regex/ and not $name =~ /$regexextn$negregex/)
886 5 0 $nocase ? :
887 5 0 $nocase ? :
890 3 20 unless defined $sorted_bmatch[$bIndex]
893 20 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) { }
917 1 4 if ($r_con->{'verbose'} >= 3)
941 0 0 $r1 ? :
0 0 if $str eq 'init'
942 0 0 unless $r1