Branch Coverage

blib/lib/File/Tail.pm
Criterion Covered Total %
branch 69 166 41.5


line true false branch
32 19 119 if (@_)
35 3 16 if $object->{'interval'} > $object->{'maxinterval'}
46 0 0 if $object->debug
54 9 38 if @_
60 0 0 if @_
68 9 0 if (@_ >= 2)
70 0 9 unless defined $mode
71 0 9 if (ref $mode eq 'CODE') { }
0 9 elsif (ref $mode eq 'ARRAY') { }
74 0 0 unless (ref $mode->[0] eq 'CODE')
90 0 0 if (@_ > 0)
107 0 0 if (@_ >= 1) { }
114 0 0 if (ref $mode eq 'CODE') { }
0 0 elsif (ref $mode eq 'ARRAY') { }
0 0 elsif ($mode eq 'return') { }
0 0 elsif ($mode eq 'warn') { }
136 9 0 if @_
142 0 0 if @_
148 0 0 if @_
154 0 29 if @_
160 9 0 if @_
166 9 10 if @_
172 9 9 if @_
178 9 0 if @_
184 0 0 if @_
190 0 0 if @_
220 14 0 if defined $this and defined $this->{'handle'}
232 0 9 unless ($pkg)
236 0 9 if ($#_ == 0) { }
239 0 9 if ($#_ % 2 != 1)
247 0 9 unless (defined $params{'name'})
266 0 9 unless $object->{'maxbuf'} > 1024
268 0 9 if (defined $params{'reset_tail'}) { }
279 9 0 if ($object->{'method'} eq 'tail')
294 2 10 if (not $object->{'tail'}) { }
4 6 elsif ($object->{'tail'} < 0) { }
305 6 0 unless $avlen
307 0 6 if int $calclen <= length $object->{'buffer'}
308 6 0 if $calclen > $maxlen
312 0 6 if $File::Tail::Is_Win32
315 6 0 if $calclen >= $maxlen
319 4 2 if ($crs > $object->{'tail'})
352 1 10 if ($oldhandle and $object->{'name_changes_callback'}) { }
359 0 11 unless (open $newhandle, "<$newname")
360 0 0 if ($object->{'ignore_nonexistant'})
365 0 0 unless ($oldhandle)
372 0 0 unless defined $object->{'endpos'}
373 0 0 unless defined $object->{'curpos'}
378 2 9 if (defined $oldhandle) { }
390 2 0 if ($st->mtime <= int $object->{'lastread'}) { }
391 0 2 if ($st->size == $object->{'curpos'} and $st->ino == $object->{'inode'}) { }
419 0 29 unless ($object->{'handle'})
421 0 0 unless ($object->{'handle'})
427 1 28 if ($object->{'endpos'} < $object->{'curpos'}) { }
2 29 elsif ($object->{'curpos'} == $object->{'endpos'} and &File::Tail::time() - $object->{'lastread'} > $object->{'resetafter'}) { }
435 6 23 if ($object->{'endpos'} - $object->{'curpos'})
446 6 29 if $crs
448 0 29 if $ttw > 0
449 0 29 if (my $len = $object->checkpending)
453 3 26 if ($object->{'sleepcount'} > $object->adjustafter)
463 0 0 unless defined $_[0]
468 0 0 if ref $_[0]
470 0 0 unless defined $object
473 0 0 if (defined $timeout) { }
481 0 0 if $minpred > $val
485 0 0 defined $timeout ? :
493 0 0 if (defined $timeout) { }
501 0 0 unless $val
502 0 0 if $minpred > $val
503 0 0 unless $val
506 0 0 if (wantarray) { }
516 0 7 if (length $object->{'buffer'})
519 0 0 if $crs
521 0 7 if $len > $object->{'maxbuf'}
526 0 7 if $File::Tail::Is_Win32
528 0 7 if $len == 0
539 7 0 if ($crs)
541 0 7 if $object->{'lastread'} > $tmp
556 0 29 if ($object->nowait)
557 0 0 if (wantarray) { }
563 29 0 if $object->interval > 0
569 1 12 if (not length $object->{'buffer'} or index($object->{'buffer'}, "\n") < 0)
572 6 7 if (not wantarray) { }