Branch Coverage

blib/lib/Text/Buffer.pm
Criterion Covered Total %
branch 59 96 61.4


line true false branch
28 0 4 if ($opts{'debug'})
30 3 1 if ($opts{'file'}) { }
0 1 elsif ($opts{'array'}) { }
35 0 0 if (ref $opts{'array'} eq 'ARRAY')
43 1 3 if exists $opts{$_}
52 0 3 unless ($file)
57 3 0 if (open FIL, $file) { }
77 0 3 unless ($file)
82 0 3 if ($$self{'file'} and $file eq $$self{'file'} and not $self->isModified) { }
91 3 0 if (open FIL, ">$file") { }
131 8 143 if ($linenum =~ /^[0-9]+$/) { }
122 21 elsif ($linenum =~ /^[+-]\d+$/) { }
17 4 elsif ($linenum =~ /^(start|top|first)$/) { }
3 1 elsif ($linenum =~ /^(end|bottom|last)$/) { }
149 20 130 if ($curr < 0 or $curr >= $self->getLineCount)
163 21 130 unless (defined $curr)
203 0 1 if (not $newline or $newline eq 'off' or $newline eq 'none') { }
1 0 elsif ($newline eq "\n" or lc $newline eq 'unix') { }
0 0 elsif ($newline eq "\r" or lc $newline eq 'mac') { }
0 0 elsif ($newline eq "\r\n" or lc $newline eq 'windows') { }
231 18 100 unless ($self->goto("+$num"))
242 0 1 unless ($self->goto("-$num"))
269 0 6 unless $match
271 1 5 if (defined $$self{'_findlast'})
277 2 19 if ($line =~ /$match/)
278 0 2 if (defined $$self{'_findlast'} and $$self{'_currline'} eq $$self{'_findlast'})
287 0 19 if ($self->isEOF and $$self{'_findwrap'})
305 0 137 if (defined $linenum) { }
307 0 137 unless (defined $linenum)
312 137 0 defined $line ? :
321 0 23 if (defined $linenum) { }
323 0 23 unless (defined $line)
328 23 0 if (not defined ${$$self{'_buffer'};}[$linenum] or ${$$self{'_buffer'};}[$linenum] ne $line)
360 30 0 defined $_ ? :
363 5 0 if $$self{'_buffer'} and ref $$self{'_buffer'} eq 'ARRAY' and $#{$$self{'_buffer'};} >= 0
371 0 1 unless defined $str
384 0 1 if ($count == $MAXCOUNT)
385 1 0 if ($count)
411 4 0 unless (defined $opts)
414 0 4 unless defined $str
421 4 0 if ($count)
457 136 8 unless $chars{$_}
471 0 0 (shift())->{'error'} ? :
488 39 98 unless $$self{'_autonewline'} and $text
498 1316 32 if (ref $self eq 'Text::Buffer') { }
499 0 1316 if (defined $level)
503 0 32 if (defined $level)
513 16 658 if ($self->_debuglevel)