Branch Coverage

lib/Log/Unrotate.pm
Criterion Covered Total %
branch 102 118 86.4


line true false branch
193 1 95 unless $_start_values{$$self{'start'}}
194 1 94 unless $_end_values{$$self{'end'}}
195 1 93 unless $$self{'check_inode'} or $$self{'check_lastline'}
199 0 93 if ($$self{'pos'} and $$self{'cursor'})
202 0 93 unless ($$self{'pos'} or $$self{'cursor'})
207 93 0 if ($posfile)
208 3 90 if ($posfile eq '-') { }
209 1 2 unless defined $$self{'log'}
213 0 2 unless defined $$self{'log'} or -e $posfile
219 40 47 if ($pos)
221 38 2 if ($$self{'log'}) { }
222 1 0 if $$self{'check_log'} and $logfile and $$self{'log'} ne $logfile
224 1 1 unless $$self{'log'} = $logfile
231 38 47 if ($pos) { }
238 32 8 unless $error
239 6 2 unless $$self{'cursor'}->rollback
242 6 32 if ($error)
243 1 5 if ($$self{'autofix_cursor'}) { }
266 54 8 if ($last_byte eq "\n")
273 4 4 if $position == 0
276 4 0 if $position < $read_portion
280 4 0 if ($data =~ /\n(.*)\z/)
304 79 0 if $handle
306 2 77 unless ($position)
310 2 0 unless open $handle, '<', $log
315 76 1 if $backstep > $position
325 122 0 if $last_line =~ /(.{0,255})$/
334 2 46 if ($$self{'start'} eq 'end') { }
43 3 elsif ($$self{'start'} eq 'begin') { }
3 0 elsif ($$self{'start'} eq 'first') { }
336 1 1 if $$self{'Handle'}
353 159 26 if (open my $FILE, "<$log") { }
0 26 elsif (-e $log) { }
355 19 140 if $stat[7] < $position
356 6 4 if $stat[7] == 0 and $$self{'LogNumber'} == 0 and $$self{'end'} eq 'fixed'
373 98 2 /\.(\d+)$/ ? :
380 2 83 unless $$self{'end'} eq 'fixed'
389 185 6 unless defined $number
391 77 114 if $number
398 10 0 defined $$pos{'LastLine'} ? :
399 10 0 defined $$pos{'Inode'} ? :
400 10 0 defined $$pos{'Position'} ? :
415 33 77 unless $self->_reopen($$pos{'Position'})
416 4 1 if $$self{'check_inode'} and $$pos{'Inode'} and $$self{'Inode'} and $$pos{'Inode'} ne $$self{'Inode'}
417 31 42 if $$self{'check_lastline'} and $$pos{'LastLine'} and $$pos{'LastLine'} ne $self->_last_line
420 34 27 if $self->_find_end_pos($$self{'Handle'}) > tell $$self{'Handle'}
423 8 27 if $$self{'LogNumber'} <= 0
425 19 8 if $self->_reopen(0)
446 3 86 unless defined $FILE
447 55 31 if (defined $$self{'EOF'} and $$self{'LogNumber'} == 0)
449 5 50 if $position >= $$self{'EOF'}
452 70 11 if (defined $line)
453 69 1 if ($line =~ /\n$/)
458 4 6 unless $self->_find_log($self->position)
475 52 3 if ($$self{'Handle'})
498 1 38 unless defined $$pos{'Position'}
513 1 2 unless defined $$self{'Handle'}
520 4 0 if @stat
521 2 2 if $number <= 0