Branch Coverage

blib/lib/Test/File.pm
Criterion Covered Total %
branch 213 278 76.6


line true false branch
76 15 59 if (not -e $filename) { }
0 59 elsif (not -f _) { }
0 59 elsif (-d _) { }
82 15 59 if ($message)
92 4 237 unless defined $file
94 3 234 $file =~ m[/] ? :
100 1 39 if $^O eq "darwin"
101 1 38 if defined $ENV{'PRETEND_TO_BE_WIN32'}
114 6 51 if $^O eq $os
116 5 20 if $^O eq "MSWin32"
119 1 19 if $@
122 1 18 if $@
141 10 1 if ($ok) { }
162 4 1 if ($ok) { }
185 1 3 unless _is_plain_file($filename)
189 2 1 if ($ok) { }
212 2 5 unless _is_plain_file($filename)
216 3 2 if ($ok) { }
240 1 3 unless _is_plain_file($filename)
244 2 1 if ($ok) { }
272 1 3 unless _is_plain_file($filename)
276 2 1 if ($ok) { }
306 1 3 unless _is_plain_file($filename)
310 2 1 if ($ok) { }
344 0 9 unless -e $filename
345 0 9 unless -f $filename
346 0 9 unless open my $fh, "<", $filename
361 4 0 unless shift()
364 1 3 unless _is_plain_file($filename)
366 1 2 unless (defined $expected and int $expected == $expected)
375 0 2 if ($got eq -1) { }
0 2 elsif ($got eq -3) { }
0 2 elsif ($got == -2) { }
1 1 elsif ($got == $expected) { }
417 5 0 unless shift()
420 1 4 unless _is_plain_file($filename)
422 1 3 unless (defined $expected and int $expected == $expected)
431 0 3 if ($got eq -1) { }
0 3 elsif ($got eq -3) { }
0 3 elsif ($got == -2) { }
2 1 elsif ($got != $expected) { }
474 8 0 unless shift()
476 3 5 unless _is_plain_file($filename)
479 1 8 unless (defined $$ref and int $$ref == $$ref)
489 0 4 if ($got eq -1) { }
0 4 elsif ($got eq -3) { }
0 4 elsif ($got == -2) { }
3 1 elsif ($min <= $got and $got <= $max) { }
630 20 14 if (ref $patterns eq 'ARRAY') { }
643 4 30 unless _is_plain_file($filename)
645 0 30 unless (-r $filename)
653 0 30 unless (open FH, $filename)
658 20 10 if (defined $encoding)
685 2 0 if ($ok) { }
707 0 0 if ($ok) { }
740 3 0 if ($ok) { }
773 0 0 if ($ok) { }
793 1 3 if (_win32())
803 2 1 if ($ok) { }
823 1 3 if (_win32())
833 2 1 if ($ok) { }
855 1 5 if (_win32())
867 4 1 if ($ok) { }
889 1 5 if (_win32())
901 4 1 if ($ok) { }
924 0 4 if (_win32())
935 4 0 $present ? :
938 2 2 if ($ok) { }
962 0 3 if (_win32())
973 3 0 $present ? :
976 2 1 if ($ok) { }
995 1 6 if (_no_symlinks_here())
1004 4 2 if (-l $file) { }
1022 0 0 if (_no_symlinks_here())
1031 0 0 unless (-e $file)
1036 0 0 if (not -l $file) { }
1055 1 5 if (_no_symlinks_here())
1066 1 4 unless (-l $file)
1072 1 3 unless (-e $dest)
1078 1 2 unless ($dest eq $actual)
1100 1 4 if (_no_symlinks_here())
1110 1 3 unless (-l $file)
1115 2 1 if (-e $dest)
1133 1 3 if (_no_symlinks_here())
1143 1 2 unless (-l $file)
1151 0 2 unless (defined $actual_dest)
1153 0 0 if defined $link_error
1157 1 1 if ($dest eq $actual_dest) { }
1176 0 0 if (_no_symlinks_here())
1184 0 0 defined $link ? :
1188 0 0 if (defined $link_abs and defined $to_abs and $link_abs eq $to_abs) { }
1202 0 0 if $link_err
1219 1 3 unless (-e $filename)
1226 2 1 if ($ok) { }
1249 1 3 unless (-d $dirname)
1256 2 1 if ($ok) { }
1282 1 2 unless ($actual == $count)
1307 1 2 unless ($actual > $count)
1333 1 2 unless ($actual < $count)
1350 3 19 if (_obviously_non_multi_user())
1360 1 18 unless (defined $filename)
1365 1 17 unless (-e $filename)
1389 0 4 if defined $err and $err eq "skip"
1390 0 4 if defined $err
1393 1 3 unless (defined $owner_uid)
1400 0 3 unless (defined $file_uid)
1405 2 1 if $file_uid == $owner_uid
1408 0 1 unless (defined $real_owner)
1434 0 4 if defined $err and $err eq "skip"
1435 0 4 if defined $err
1438 1 3 unless (defined $owner_uid)
1445 2 1 if $file_uid != $owner_uid
1468 0 5 if defined $err and $err eq "skip"
1469 0 5 if defined $err
1472 1 4 unless (defined $group_gid)
1479 0 4 unless (defined $file_gid)
1484 3 1 if $file_gid == $group_gid
1487 0 1 unless (defined $real_group)
1515 0 4 if defined $err and $err eq "skip"
1516 0 4 if defined $err
1521 0 4 unless (defined $file_gid)
1526 3 1 if $file_gid != $group_gid
1546 2 6 if $arg =~ /\A[0-9]+\z/
1556 2 6 if (defined $from_uid and not defined $from_nam) { }
4 2 elsif (not defined $from_uid and defined $from_nam) { }
2 0 elsif (not defined $from_uid || defined $from_nam) { }
1590 3 6 if $arg =~ /\A[0-9]+\z/
1600 3 6 if (defined $from_gid and not defined $from_nam) { }
5 1 elsif (not defined $from_gid and defined $from_nam) { }
1 0 elsif (not defined $from_gid || defined $from_nam) { }
1637 0 4 if $filetime == -1
1639 2 2 if $filetime + $within_secs > $time - 1
1659 0 3 if $filetime == -1
1661 2 1 if $filetime > $time
1682 0 3 if $filetime == -1
1684 2 1 if $filetime < $time
1705 1 11 unless (defined $filename)
1710 1 10 unless (-e $filename)
1717 0 10 unless ($filetime)