Branch Coverage

lib/Lock/File.pm
Criterion Covered Total %
branch 53 70 75.7


line true false branch
27 0 1140 unless defined $fh
28 906 234 if $$self{'_remove'} and $$self{'_fname'}
45 15 1809 if %$opts_copy
60 0 1673 if (@_ > 2 or @_ < 1)
67 1 642 if (exists $$opts{'blocking'} and not $$opts{'blocking'} and defined $$opts{'timeout'})
73 1657 0 if (ref $param eq '') { }
80 482 1140 unless ($fh)
94 15 0 if ($bang)
97 0 15 if (defined $question and $question > 0)
98 0 0 if $question & 127
99 0 0 if $question & 128
100 0 0 if $question >> 8
110 30 3184 if (defined $chmod) { }
111 0 30 if $chmod =~ s/^0//
120 15 3199 unless $res
127 0 1657 unless (defined $fname)
128 0 0 _lock(@_) ? :
134 482 2697 unless $lock
136 481 2216 unless (-e $fname)
140 1076 1140 unless ((stat $fh)[1] eq (stat $fname)[1])
150 19 1524 unless flock $fh, $mode
158 24 3175 $$opts{'shared'} ? :
160 643 2556 if (not $$opts{'blocking'} or defined $$opts{'timeout'} and not $$opts{'timeout'})
164 160 483 if flock $fh, $mode | 4
165 483 0 if ($! == 11)
166 1 482 if defined $$opts{'timeout'}
172 1541 1015 if (not flock($fh, $mode | 4)) { }
179 55 1486 if ($$opts{'timeout'}) { }
206 458 87 unless $lock
208 78 467 if ($locked >= $max)
215 50 95 if ($locked < $max and not $ret)
218 85 50 if $flist{$file}
220 0 50 unless $lock
226 67 78 if defined $ret
242 4 6 if $lock