Branch Coverage

blib/lib/Pid/File/Flock.pm
Criterion Covered Total %
branch 22 66 33.3


line true false branch
136 1 1 if (/^:(.+)/)
139 1 0 if (/^([^=]+)=([^=]+)$/)
145 1 2 if $iopts{'auto'}
157 2 0 if @_ % 2
160 0 2 if $opts{'debug'}
164 0 2 if $opts{'debug'}
170 0 2 unless ($fh)
172 0 0 if ($opts{'wait'})
178 0 0 if $opts{'debug'}
184 0 0 if $@ and $@ ne "x\n" and $@ =~ /^(.+)\n?/
185 0 0 if $fh
188 0 0 if ($opts{'raise'} or not $opts{'quiet'})
189 0 0 unless (sysopen FH, $path, 0)
190 0 0 unless $!{'ENOENT'}
192 0 0 $opts{'raise'} ? :
201 0 2 if ($opts{'debug'})
203 0 0 unless sysseek $fh, 0, 0
205 0 2 unless truncate $fh, 0 and syswrite $fh, $$
219 0 2 unless sysopen FH, $path, 66
222 0 2 $opts{'block'} ? :
223 0 2 unless (flock FH, 2 | $nb)
224 0 0 unless $!{'EAGAIN'}
229 0 2 if $^O eq 'MSWin32'
232 0 2 unless my(@stath) = stat FH
233 0 2 unless (my(@statf) = stat $path)
234 0 0 unless $!{'ENOENT'}
236 0 0 if $opts{'recurs'}
238 0 0 if $opts{'debug'}
243 0 2 unless ($stath[0] == $statf[0] and $stath[1] == $statf[1])
244 0 0 if $opts{'debug'}
259 2 2 unless ref $self
261 0 2 unless unlink $$self{'path'}
271 2 0 unless $_[0]{'abandoned'}