Branch Coverage

blib/lib/Text/Format.pm
Criterion Covered Total %
branch 104 276 37.6


line true false branch
27 0 13 unless ref $this
29 13 0 if @_ > 0
32 0 13 if ref $_[0] eq "ARRAY"
34 0 13 if @wrap < 1
42 0 13 unless defined $words[0] and $words[0] ne ""
55 13 0 if defined $line
62 38 8 if (length($nextword) + length($line) < $width - 1 or !($line =~ /[.?!]['"]?$/) || $abbrev and length($nextword) + length($line) < $width) { }
66 0 38 if $line =~ /[.?!]['"]?$/ and not $abbrev
77 0 13 if $this->{'_nobreak'} and defined $line
78 13 0 if defined $line
88 8 5 if defined $line
93 208 48 if (length($nextword) + length($line) < $width - 1 or !($line =~ /[.?!]['"]?$/) || $abbrev and length($nextword) + length($line) < $width) { }
97 6 202 if $line =~ /[.?!]['"]?$/ and not $abbrev
104 0 48 if $this->{'_nobreak'}
105 48 0 if defined $line
110 256 0 if defined $nextword
113 8 5 if defined $line
116 0 13 if ($this->{'_hindent'} and @wrap > 0)
119 0 0 unless defined $caller
123 0 0 if defined $this->{'_hindtext'}[0] and length $this->{'_hindcurr'} < 1 and $caller ne "Text::Format::paragraphs"
127 0 0 if ($white - $this->{'_lmargin'} - 1 > length $this->{'_hindcurr'}) { }
142 2 11 wantarray ? :
150 0 1 unless ref $this
152 1 0 if @_ > 0
155 0 1 if ref $_[0] eq "ARRAY"
157 0 1 if @wrap < 1
163 0 1 if ($this->{'_findent'} == $this->{'_bindent'} or $this->{'_hindent'}) { }
177 0 2 if $this->{'_hindent'}
179 0 2 unless defined $this->{'_hindcurr'}
181 2 0 if defined $line and length $line > 0
185 0 1 if defined $ret[$#ret] and $ret[$#ret] =~ /\n\n$/
192 1 0 wantarray ? :
200 0 1 unless ref $this
202 1 0 if @_ > 0
204 0 1 if @center < 1
216 2 0 if length $nextword > 0
219 2 0 if length $nextword > 0
226 1 0 wantarray ? :
234 0 0 unless ref $this
236 0 0 if @_ > 0
238 0 0 if @lines < 1
248 0 0 if (wantarray) { }
256 0 0 unless ref $this
267 0 0 if (wantarray) { }
276 1 2 if (ref $_[0] eq 'HASH') { }
2 0 elsif (scalar(@_) % 2 == 0) { }
289 0 3 if ref $this
312 3 0 if (ref $ref eq "HASH")
315 1 2 if defined $ref->{'columns'}
317 0 3 if defined $ref->{'tabstop'}
319 1 2 if defined $ref->{'firstIndent'}
321 0 3 if defined $ref->{'bodyIndent'}
323 0 3 if defined $ref->{'rightFill'}
325 0 3 if defined $ref->{'rightAlign'}
327 0 3 if defined $ref->{'justify'}
329 0 3 if defined $ref->{'leftMargin'}
331 0 3 if defined $ref->{'rightMargin'}
333 0 3 if defined $ref->{'extraSpace'}
336 0 3 if defined $ref->{'abbrevs'} and ref $ref->{'abbrevs'} eq "HASH"
339 0 3 if defined $ref->{'text'} and ref $ref->{'text'} eq "ARRAY"
341 0 3 if defined $ref->{'hangingIndent'}
344 0 3 if defined $ref->{'hangingText'} and ref $ref->{'hangingText'} eq "ARRAY"
346 0 3 if defined $ref->{'noBreak'}
349 0 3 if defined $ref->{'noBreakRegex'} and ref $ref->{'noBreakRegex'} eq "HASH"
352 0 3 ref $this ? :
362 0 7 unless ref $this
365 7 0 if (ref $_[0] eq 'HASH') { }
0 0 elsif (scalar(@_) % 2 == 0) { }
381 3 4 if defined $conf->{'columns'}
383 0 7 if defined $conf->{'tabstop'}
385 0 7 if defined $conf->{'firstIndent'}
387 0 7 if defined $conf->{'bodyIndent'}
389 7 0 if defined $conf->{'rightFill'}
391 0 7 if defined $conf->{'rightAlign'}
393 7 0 if defined $conf->{'justify'}
395 0 7 if defined $conf->{'leftMargin'}
397 0 7 if defined $conf->{'rightMargin'}
399 4 3 if defined $conf->{'extraSpace'}
402 0 7 if defined $conf->{'abbrevs'} and ref $conf->{'abbrevs'} eq "HASH"
405 0 7 if defined $conf->{'text'} and ref $conf->{'text'} eq "ARRAY"
407 0 7 if defined $conf->{'hangingIndent'}
410 0 7 if defined $conf->{'hangingText'} and ref $conf->{'hangingText'} eq "ARRAY"
412 0 7 if defined $conf->{'noBreak'}
415 0 7 if defined $conf->{'noBreakRegex'} and ref $conf->{'noBreakRegex'} eq "HASH"
423 0 1 unless ref $this
428 1 0 if (@_) { }
434 0 0 unless ref $this
439 0 0 if (@_) { }
445 0 0 unless ref $this
450 0 0 if (@_) { }
456 0 1 unless ref $this
461 1 0 if (@_) { }
467 0 0 unless ref $this
472 0 0 if (@_) { }
478 0 0 unless ref $this
483 0 0 if (@_) { }
489 0 0 unless ref $this
494 0 0 if (@_) { }
500 0 0 unless ref $this
505 0 0 if (@_) { }
511 0 0 unless ref $this
516 0 0 if (@_) { }
522 0 0 unless ref $this
527 0 0 if (@_) { }
535 0 0 unless ref $this
538 0 0 if (ref $_[0] eq 'HASH') { }
0 0 elsif (@_ > 0) { }
550 0 0 wantarray ? :
557 0 0 unless ref $this
561 0 0 if ref $text eq "ARRAY"
566 0 0 wantarray ? :
572 0 0 unless ref $this
577 0 0 if (@_) { }
583 0 0 unless ref $this
587 0 0 if ref $text eq "ARRAY"
592 0 0 wantarray ? :
598 0 0 unless ref $this
603 0 0 if (@_) { }
609 0 0 unless ref $this
613 0 0 if ref $nobreak eq "HASH"
623 0 69 unless ref $this
630 32 37 if $this->{'_fill'} and not $this->{'_align'}
631 26 3 if ($this->{'_justify'} and not $this->{'_fill'} || $this->{'_align'} and defined $line and $line =~ /\S+\s+\S+/ and $not_last)
640 9 17 if $ws > 0
646 137 111 if $nextword =~ /^\S/
648 78 33 unless $spaces
654 69 0 if defined $line
658 0 0 if $this->{'_align'} and not $this->{'_fill'} and defined $line
667 0 315 unless ref $this
671 315 0 if defined $word
678 0 136 if not $this->{'_space'} or exists $abbrev{$word} or exists do { $$this{"_abbrs"} }->{$word}
687 0 0 unless ref $this
691 0 0 if defined $line
698 0 0 if $last_word =~ /$_/ and $next_line =~ /do { $$this{"_nobreakregex"} }->{$_}/
703 0 0 if ($no_break and @words > 1)
711 0 0 if $words[$i - 1] =~ /$_/ and $words[$i] =~ /do { $$this{"_nobreakregex"} }->{$_}/
716 0 0 unless $no_break
718 0 0 if ($i > 0)