Branch Coverage

blib/lib/IO/ReStoreFH.pm
Criterion Covered Total %
branch 19 26 73.0


line true false branch
54 8 2 if (ref $fh or 'GLOB' eq ref \$fh) { }
1 1 elsif (&Scalar::Util::looks_like_number($fh) and POSIX::ceil($fh) == POSIX::floor($fh)) { }
59 3 5 unless FileHandle::Fmode::is_FH($fh)
64 1 0 FileHandle::Fmode::is_W($fh) && FileHandle::Fmode::is_R($fh) ? :
4 1 FileHandle::Fmode::is_WO($fh) ? :
0 5 FileHandle::Fmode::is_RO($fh) ? :
72 0 5 unless defined $mode
75 1 4 if FileHandle::Fmode::is_A($fh)
78 0 5 unless open my $dup, $mode . '&', $fh
90 0 1 unless my $dup = POSIX::dup($fh)
112 1 5 if (exists $dup->{'fd'}) { }
114 0 1 unless POSIX::dup2($dup->{'dup'}, $dup->{'fd'})
120 0 5 unless open $dup->{'fh'}, $dup->{'mode'} . '&', $dup->{'dup'}