Branch Coverage

blib/lib/Text/ANSI/BaseUtil.pm
Criterion Covered Total %
branch 186 352 52.8


line true false branch
20 2 2 $text =~ /$re/s ? :
27 0 0 unless $code =~ /\A$re_capture\z/
36 0 0 if ($num == 0) { }
0 0 elsif ($num == 1) { }
0 0 elsif ($num == 2) { }
0 0 elsif ($num == 3) { }
0 0 elsif ($num == 4) { }
0 0 elsif ($num == 5) { }
0 0 elsif ($num == 7) { }
0 0 elsif ($num == 8) { }
0 0 elsif ($num == 9) { }
0 0 elsif ($num == 21) { }
0 0 elsif ($num == 22) { }
0 0 elsif ($num == 23) { }
0 0 elsif ($num == 24) { }
0 0 elsif ($num == 25) { }
0 0 elsif ($num == 27) { }
0 0 elsif ($num == 28) { }
0 0 elsif ($num == 29) { }
0 0 elsif ($num >= 30 and $num <= 37) { }
0 0 elsif ($num == 38) { }
0 0 elsif ($num == 39) { }
0 0 elsif ($num >= 40 and $num <= 47) { }
0 0 elsif ($num == 48) { }
0 0 elsif ($num == 49) { }
101 0 0 if ($num2 == 5) { }
0 0 elsif ($num2 == 2) { }
116 0 0 if ($num2 == 5) { }
0 0 elsif ($num2 == 2) { }
135 0 0 if ($state->{'reset'})
139 0 0 if (defined $state->{'fgcolor'})
142 0 0 if (defined $state->{'bgcolor'})
145 0 0 if (defined $state->{'bold'})
146 0 0 $state->{'bold'} ? :
148 0 0 if (defined $state->{'dim'})
149 0 0 $state->{'dim'} ? :
151 0 0 if (defined $state->{'italic'})
152 0 0 $state->{'italic'} ? :
154 0 0 if (defined $state->{'underline'})
155 0 0 $state->{'underline'} ? :
157 0 0 if (defined $state->{'blink'})
158 0 0 $state->{'blink'} ? :
160 0 0 if (defined $state->{'reverse'})
161 0 0 $state->{'reverse'} ? :
163 0 0 if (defined $state->{'conceal'})
164 0 0 $state->{'conceal'} ? :
166 0 0 if (defined $state->{'strike'})
167 0 0 $state->{'strike'} ? :
170 0 0 @nums ? :
183 3 4 if ($e =~ /\n/)
187 3 1 if $num_lines == 0
188 0 4 $is_mb ? :
239 0 6 if ($_ eq "\t") { }
258 0 10 $is_mb ? :
262 0 10 $is_mb ? :
286 0 237 if ($is_mb and $1) { }
114 123 elsif ($3) { }
291 0 123 if ($is_mb) { }
294 0 0 if ($1) { }
308 5 20 unless @s
312 20 242 unless $only_code or defined $s
314 5 237 if ($only_code)
316 5 0 if defined $c
320 123 119 if ($s_type and $s_type ne 's') { }
114 5 elsif (length $s) { }
321 111 12 if ($prev_type eq 's') { }
0 22 elsif ($prev_type and $prev_type ne $s_type) { }
335 0 0 $is_mb ? :
341 9 114 if defined $c and not @s
342 8 7 unless (@s or @ch)
347 0 8 $is_mb ? :
351 113 1 if ($prev_type ne "s")
356 0 113 $is_mb ? :
362 3 111 if defined $c and not @s
363 2 3 unless (@s or @ch)
374 25 217 unless (@s)
375 17 8 if (defined $c and $c =~ /m\z/)
376 8 9 if ($c eq "\e[0m") { }
9 0 elsif ($c =~ /m\z/) { }
384 5 20 if $only_code
395 113 121 if ($termst[$i] eq "s")
396 2 111 if ($pterms[$i] =~ /[ \t]*(\n(?:[ \t]*\n)+)([ \t]*)/)
400 2 0 if ($i < @pterms - 1)
405 0 2 if (length $2)
437 0 10 unless $tw > 0
439 0 2 $is_mb ? :
2 8 if defined $optfli
441 0 2 $is_mb ? :
2 8 if defined $optsli
452 224 10 if $i
457 224 10 $i > 0 ? :
461 2 232 if ($termt eq "p")
465 0 4 if $crcode and $_ == 1
466 0 4 if $pad
477 12 220 if ($is_parastart)
478 10 2 unless (defined $fli)
483 0 10 if ($termt eq 's') { }
485 0 0 $is_mb ? :
493 8 2 unless (defined $sli)
496 82 89 if ($termst[$j] eq "s")
497 0 82 if ($pterms[$j] =~ /\n([ \t]+)/)
499 0 0 $is_mb ? :
509 0 10 if $sliw >= $width
519 111 121 if ($termt eq "s")
524 2 109 if ($pterm =~ /\n/ and $i == $#terms)
525 0 2 if $crcode
526 0 2 if $pad
532 121 111 if ($termt ne "s")
545 121 3 if ($termw <= $width - $sliw or $termt eq "c")
549 109 12 $prev_t && $prev_t eq 's' ? :
553 0 3 $is_mb ? :
557 3 0 if ($j == 1) { }
570 0 0 $crcode ? :
580 2 1 $prev_t && $prev_t eq 's' ? :
3 0 $j == 1 ? :
582 0 3 $is_mb ? :
594 21 103 if not defined $maxww or $maxww < $wordw
595 14 110 if not defined $minww or $minww > $wordw
597 112 12 $line_has_word ? :
106 18 if ($x + ($line_has_word ? 1 : 0) + $wordw <= $width) { }
598 94 12 if ($line_has_word and $ws_before)
607 0 18 if ($wordt eq 'c') { }
610 0 0 if ($ws_before) { }
621 3 15 if $crcode
623 0 18 if $pad
624 0 18 if $ws_before and $optkts
630 18 0 if ($sliw + $wordw <= $width) { }
646 0 10 if $line_has_word and $pad
649 1 9 if ($opts->{'return_stats'}) { }
669 3 4 if ($which) { }
676 0 7 $is_mb ? :
678 1 6 if ($is_trunc and $w > $width) { }
679 0 1 $is_mb ? :
683 1 5 if ($which eq 'l') { }
1 4 elsif ($which eq 'c') { }
689 3 1 if $width > $w
710 0 16 $is_mb ? :
711 2 14 if ($w <= $width)
712 0 2 $return_extra ? :
724 32 13 if ($append) { }
725 0 32 $is_mb ? :
727 22 10 if ($w + $tw <= $width) { }
731 4 18 if $w == $width
734 0 10 $is_mb ? :
748 39 6 if (defined $ansi)
749 18 21 if ($append) { }
750 1 17 if ($ansi eq "\e[0m") { }
771 10 4 if ($return_extra) { }
805 8 0 if (defined $c and $c =~ /m\z/)
806 2 6 if ($c eq "\e[0m") { }
6 0 elsif ($c =~ /m\z/) { }
817 0 2 if (ref $needle eq 'Regexp') { }
819 0 0 unless @m
825 0 0 if $p >= 0
827 0 0 unless @pt
831 0 0 if ($pmin > $_->[0] or $pmin == $_->[0] and length $t < length $_->[1])
839 0 0 unless $is_all
847 1 3 if $p < 0
850 1 2 unless $is_all
852 0 2 if $pos >= length $plaintext
854 0 2 unless @needle
866 2 9 if $i >= @chptext
870 4 5 if ($pos > $npos2 or $pos2 < $npos or not $found)
874 4 0 if defined $chcode[$i]
879 3 2 if ($pos < $npos)
888 5 0 if (length $npart)
897 3 2 if ($npos2 <= $pos2)
901 1 2 if (@needle) { }
914 2 0 unless ($found)
917 2 0 if defined $chcode[$i]
945 1 3 $i > 1 && !$savedc ? :
951 3 4 if (defined $c and $c =~ /m\z/)
953 1 2 if ($c eq "\e[0m") { }
2 0 elsif ($c =~ /m\z/) { }
961 2 2 if $savedc and $i < @text
977 2 1 if (@_) { }