Branch Coverage

blib/lib/Test/Virtual/Filesystem.pm
Criterion Covered Total %
branch 102 210 48.5


line true false branch
279 9 12 ref $feature_defaults{$_} ? :
297 0 0 if @_ == 1
298 0 0 if @_ == 2
305 0 0 if @_ == 1
306 0 0 if @_ == 2
323 0 0 if (ref $$hash{$key}) { }
326 0 0 if (@arg)
327 0 0 $arg[0] ? :
343 0 48 unless (defined $$self{'mountdir'})
346 0 48 unless (-d $$self{'mountdir'})
349 0 48 unless ('File::Spec'->file_name_is_absolute($$self{'mountdir'}))
352 0 48 if ('File::Spec'->splitdir($$self{'mountdir'}) <= 2)
358 0 48 unless (-d $$self{'tempdir'})
374 48 0 if (defined $tmpdir and -e $tmpdir)
376 48 0 if ($tmpdir ne $$self{'mountdir'})
377 0 48 unless rmdir $tmpdir
380 0 48 if (defined $tmpdir and -d $tmpdir)
389 66 116 if '.' eq $file
390 66 50 if '..' eq $file
392 0 50 if length $path <= length $$self{'mountdir'}
393 0 42 unless -l $path or -e $path
394 8 42 if (-l $path) { }
18 24 elsif (-d $path) { }
395 0 8 unless unlink $path
398 0 18 unless rmdir $path
400 0 24 unless unlink $path
422 0 134 if ($symbol eq 'ANON') { }
441 41 2 unless $$self{'compatible'}
442 0 2 if $introduced_version le $$self{'compatible'}
474 0 35 if ($symbol eq 'ANON') { }
478 35 0 ref $features ? :
483 5 8 if $blocking_feature
493 2 11 if $feature_disabled{$feature}
496 0 15 unless ref $opts
497 3 12 unless $$opts{$part}
694 0 1 unless unlink $f
706 0 1 unless mkdir $f
719 1 0 unless mkdir $f
733 0 1 unless mkdir $f
735 0 1 unless rmdir $f
749 0 1 unless mkdir $d
765 0 1 unless mkdir $src
768 0 1 unless ok symlink($target, $s), 'created symlink'
775 0 1 unless unlink $s
792 0 1 unless mkdir $srcdir
796 0 1 unless ok symlink($target, $s), 'created symlink'
803 0 1 unless unlink $symfile
824 0 1 unless mkdir $srcdir
830 0 1 unless ok symlink($target, $s[0]), 'created symlink'
832 0 4 unless ok symlink('symlink_' . $i, $s[$i]), 'created symlink'
841 0 1 unless unlink $symfile
857 0 1 unless ok symlink($target, $s), 'created symlink'
859 1 0 unless open my $fh, '<', $s
879 0 1 unless ok truncate($f, 4), 'truncate to 4 bytes'
881 0 1 unless ok truncate($f, 0), 'truncate to 0 bytes'
883 0 1 unless ok truncate($f, 0), 'truncate to 0 bytes'
896 1 0 unless truncate $f, 0
912 1 0 unless truncate $f, 0
927 0 1 unless mkdir $d
929 1 0 unless truncate $d, 0
950 0 1 unless cmp_ok $mtime, '>=', $before - $TIME_LENIENCE, 'mtime vs. before time'
970 0 1 unless cmp_ok $ctime, '>=', $before - $TIME_LENIENCE, 'ctime vs. before time'
988 0 1 unless utime $old_atime, $old_mtime - 100, $f
1006 0 0 unless utime $old_atime - 100, $old_mtime, $f
1039 0 0 if (File::ExtAttr::getfattr($f, $xattr_key))
1127 0 1 unless mkdir $srcdir
1128 0 1 unless mkdir $destdir
1147 1 0 unless rename $src, $dest
1164 1 0 unless rename $src, $dest
1182 1 0 unless rename $src, $dest
1198 0 1 unless mkdir $src
1221 0 1 unless mkdir $src
1222 0 1 unless mkdir $dest
1224 0 1 if ($Test::Virtual::Filesystem::OSNAME eq 'MSWin32')
1247 0 1 unless mkdir $src
1248 0 1 unless mkdir $dest
1251 1 0 unless rename $src, $dest
1270 0 1 unless mkdir $src
1293 0 1 unless mkdir $srcdir
1294 0 1 unless mkdir $destdir
1295 0 1 unless mkdir $src
1317 0 1 unless mkdir $dest
1319 1 0 unless rename $src, $dest
1335 0 1 unless mkdir $src
1338 0 1 if ($Test::Virtual::Filesystem::OSNAME eq 'MSWin32' or $Test::Virtual::Filesystem::OSNAME eq 'cygwin')
1343 1 0 unless rename $src, $dest
1361 0 1 unless symlink $srcfile, $src
1378 14 0 if $eval_error and $num_errno and any sub { $_ == $num_errno; } , @{$expected_errnos;}
1380 0 0 if (not $eval_error) { }
0 0 elsif (1 == @{$expected_errnos;}) { }
1391 0 81 unless $path =~ s[\A /][]msx
1398 1 28 unless open my $fh, '>', $f
1401 0 23 unless print {$fh;} $content
1403 0 28 unless close $fh
1409 0 1 unless open my $fh, '>>', $f
1412 0 1 unless print {$fh;} $content
1414 0 1 unless close $fh
1420 0 14 unless open my $fh, '<', $f
1423 0 14 unless close $fh
1429 1 0 unless open my $fh, '<', $f
1432 0 0 unless close $fh
1438 0 71 unless opendir my $fh, $f
1440 0 71 unless closedir $fh
1446 1 0 unless opendir my $fh, $f
1448 0 0 unless closedir $fh