Branch Coverage

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


line true false branch
370 0 11 unless ref $this
372 11 0 if @_ > 0
375 0 11 if ref $_[0] eq 'ARRAY'
377 0 11 if @wrap < 1
385 0 11 unless defined $words[0] and $words[0] ne ''
394 11 0 if defined $line
397 36 8 if (length($_) + length($line) < $width - 1 or !($line =~ /[.?!]['"]?$/) || $abbrev and length($_) + length($line) < $width) { }
400 0 36 if $line =~ /[.?!]['"]?$/ and not $abbrev
410 0 11 if $this->{'_nobreak'} and defined $line
411 11 0 if defined $line
417 8 3 if defined $line
420 208 48 if (length($_) + length($line) < $width - 1 or !($line =~ /[.?!]['"]?$/) || $abbrev and length($_) + length($line) < $width) { }
423 6 202 if $line =~ /[.?!]['"]?$/ and not $abbrev
429 0 48 if $this->{'_nobreak'}
430 48 0 if defined $line
434 256 0 if defined $_
437 8 3 if defined $line
440 0 11 if ($this->{'_hindent'} and @wrap > 0)
442 0 0 unless defined $caller
446 0 0 if defined $this->{'_hindtext'}[0] and length $this->{'_hindcurr'} < 1 and $caller ne 'Text::Format::paragraphs'
450 0 0 if ($white - $this->{'_lmargin'} - 1 > length $this->{'_hindcurr'}) { }
461 2 9 wantarray ? :
469 0 1 unless ref $this
471 1 0 if @_ > 0
474 0 1 if ref $_[0] eq 'ARRAY'
476 0 1 if @wrap < 1
482 0 1 if ($this->{'_findent'} == $this->{'_bindent'} or $this->{'_hindent'}) { }
493 0 2 if $this->{'_hindent'}
495 0 2 unless defined $this->{'_hindcurr'}
497 2 0 if defined $line and length $line > 0
501 0 1 if defined $ret[$#ret] and $ret[$#ret] =~ /\n\n$/
506 1 0 wantarray ? :
514 0 1 unless ref $this
516 1 0 if @_ > 0
518 0 1 if @center < 1
527 2 0 if length $_ > 0
529 2 0 if length $_ > 0
535 1 0 wantarray ? :
543 0 0 unless ref $this
545 0 0 if @_ > 0
547 0 0 if @lines < 1
555 0 0 wantarray ? :
563 0 0 unless ref $this
572 0 0 wantarray ? :
581 1 1 if (ref $_[0] eq 'HASH') { }
1 0 elsif (scalar(@_) % 2 == 0) { }
591 0 2 if ref $this
614 2 0 if (ref $ref eq 'HASH')
616 1 1 if defined $ref->{'columns'}
618 0 2 if defined $ref->{'tabstop'}
620 1 1 if defined $ref->{'firstIndent'}
622 0 2 if defined $ref->{'bodyIndent'}
624 0 2 if defined $ref->{'rightFill'}
626 0 2 if defined $ref->{'rightAlign'}
628 0 2 if defined $ref->{'justify'}
630 0 2 if defined $ref->{'leftMargin'}
632 0 2 if defined $ref->{'rightMargin'}
634 0 2 if defined $ref->{'extraSpace'}
637 0 2 if defined $ref->{'abbrevs'} and ref $ref->{'abbrevs'} eq 'HASH'
640 0 2 if defined $ref->{'text'} and ref $ref->{'text'} eq 'ARRAY'
642 0 2 if defined $ref->{'hangingIndent'}
645 0 2 if defined $ref->{'hangingText'} and ref $ref->{'hangingText'} eq 'ARRAY'
647 0 2 if defined $ref->{'noBreak'}
650 0 2 if defined $ref->{'noBreakRegex'} and ref $ref->{'noBreakRegex'} eq 'HASH'
653 0 2 ref $this ? :
662 0 7 unless ref $this
665 7 0 if (ref $_[0] eq 'HASH') { }
0 0 elsif (scalar(@_) % 2 == 0) { }
678 3 4 if defined $conf->{'columns'}
680 0 7 if defined $conf->{'tabstop'}
682 0 7 if defined $conf->{'firstIndent'}
684 0 7 if defined $conf->{'bodyIndent'}
686 7 0 if defined $conf->{'rightFill'}
688 0 7 if defined $conf->{'rightAlign'}
690 7 0 if defined $conf->{'justify'}
692 0 7 if defined $conf->{'leftMargin'}
694 0 7 if defined $conf->{'rightMargin'}
696 4 3 if defined $conf->{'extraSpace'}
699 0 7 if defined $conf->{'abbrevs'} and ref $conf->{'abbrevs'} eq 'HASH'
702 0 7 if defined $conf->{'text'} and ref $conf->{'text'} eq 'ARRAY'
704 0 7 if defined $conf->{'hangingIndent'}
707 0 7 if defined $conf->{'hangingText'} and ref $conf->{'hangingText'} eq 'ARRAY'
709 0 7 if defined $conf->{'noBreak'}
712 0 7 if defined $conf->{'noBreakRegex'} and ref $conf->{'noBreakRegex'} eq 'HASH'
720 0 1 unless ref $this
724 1 0 @_ ? :
730 0 0 unless ref $this
734 0 0 @_ ? :
740 0 0 unless ref $this
744 0 0 @_ ? :
750 0 1 unless ref $this
754 1 0 @_ ? :
760 0 0 unless ref $this
764 0 0 @_ ? :
770 0 0 unless ref $this
774 0 0 @_ ? :
780 0 0 unless ref $this
784 0 0 @_ ? :
790 0 0 unless ref $this
794 0 0 @_ ? :
800 0 0 unless ref $this
804 0 0 @_ ? :
810 0 0 unless ref $this
814 0 0 @_ ? :
822 0 0 unless ref $this
825 0 0 if (ref $_[0] eq 'HASH') { }
0 0 elsif (@_ > 0) { }
834 0 0 wantarray ? :
841 0 0 unless ref $this
845 0 0 if ref $text eq 'ARRAY'
849 0 0 wantarray ? :
855 0 0 unless ref $this
859 0 0 @_ ? :
865 0 0 unless ref $this
869 0 0 if ref $text eq 'ARRAY'
873 0 0 wantarray ? :
879 0 0 unless ref $this
883 0 0 @_ ? :
889 0 0 unless ref $this
893 0 0 if ref $nobreak eq 'HASH'
903 0 67 unless ref $this
910 32 35 if $this->{'_fill'} and not $this->{'_align'}
911 26 3 if ($this->{'_justify'} and not $this->{'_fill'} || $this->{'_align'} and defined $line and $line =~ /\S+\s+\S+/ and $not_last)
916 9 17 if $ws > 0
920 137 111 if /^\S/
922 78 33 unless $spaces
928 67 0 if defined $line
932 0 0 if $this->{'_align'} and not $this->{'_fill'} and defined $line
941 0 311 unless ref $this
945 311 0 if defined $word
951 0 136 if not $this->{'_space'} or exists $abbrev{$word} or exists do { $$this{'_abbrs'} }->{$word}
960 0 0 unless ref $this
964 0 0 if defined $line
969 0 0 if $last_word =~ /$_/ and $next_line =~ /do { $$this{'_nobreakregex'} }->{$_}/
974 0 0 if ($no_break and @words > 1)
979 0 0 if $words[$i - 1] =~ /$_/ and $words[$i] =~ /do { $$this{'_nobreakregex'} }->{$_}/
985 0 0 unless $no_break
987 0 0 if ($i > 0)