Branch Coverage

blib/lib/Text/ANSITable.pm
Criterion Covered Total %
branch 135 380 35.5


line true false branch
211 0 2 if ($ENV{'ANSITABLE_STYLE_SETS'})
214 0 0 unless ref $sets eq 'ARRAY'
217 0 0 if (ref $set eq 'ARRAY') { }
225 0 2 if ($ENV{'ANSITABLE_STYLE'})
230 0 0 unless $k ~~ $STYLES
238 2 0 unless ($self->{'border_style'})
249 0 2 if ($linux_vc)
254 0 2 if $linux_vc
258 2 0 unless (defined $ENV{'UTF8'})
261 2 0 unless 'utf8' ~~ \@layers
264 0 2 if (defined $ENV{'ANSITABLE_BORDER_STYLE'}) { }
0 2 elsif ($use_utf8) { }
0 2 elsif ($self->use_box_chars) { }
278 2 0 unless ($self->{'color_theme'})
280 0 2 if (defined $ENV{'ANSITABLE_COLOR_THEME'}) { }
0 2 elsif ($self->use_color) { }
284 0 0 if ($self->color_depth >= 16777216) { }
285 0 0 $bg eq 'ffffff' ? :
288 0 0 $bg eq 'ffffff' ? :
297 2 0 unless (defined $self->{'wide'})
298 2 0 eval {
302 2 0 if ($self->{'wide'}) { }
316 1 0 if $self->{'_columns_set'}++
317 0 0 if $row
322 1 6 unless ref $row eq 'ARRAY'
324 1 5 unless $self->{'_columns_set'}++
325 0 6 if ($styles)
340 0 0 unless @{$self->{'_row_separators'};} and $self->{'_row_separators'}[-1] == $idx
346 1 1 unless ref $rows eq 'ARRAY'
355 26 10 if &looks_like_number($colname)
358 9 5 if $cols->[$i] eq $colname
394 0 0 ref $_[0] eq 'HASH' ? :
398 0 0 unless $style ~~ $COLUMN_STYLES
417 0 0 if (ref $cond ne 'CODE')
422 0 0 if (ref $_[0] eq 'HASH') { }
429 0 0 unless $style ~~ $COLUMN_STYLES
447 16 1 if (defined $self->{'_draw'}{'eff_column_styles'}[$col])
464 0 0 unless $res
465 0 0 if (ref $res eq 'HASH')
473 0 1 if ($rss)
492 0 0 ref $_[0] eq 'HASH' ? :
496 0 0 unless $style ~~ $ROW_STYLES
515 0 0 if (ref $cond ne 'CODE')
520 0 0 if (ref $_[0] eq 'HASH') { }
527 0 0 unless $style ~~ $ROW_STYLES
543 18 2 if (defined $self->{'_draw'}{'eff_row_styles'}[$row])
560 0 0 unless $res
561 0 0 if (ref $res eq 'HASH')
569 0 2 if ($rss)
592 0 2 ref $_[0] eq 'HASH' ? :
596 0 2 unless $style ~~ $CELL_STYLES
615 0 0 if (ref $cond ne 'CODE')
620 0 0 if (ref $_[0] eq 'HASH') { }
627 0 0 unless $style ~~ $CELL_STYLES
643 8 2 if (defined $self->{'_draw'}{'eff_cell_styles'}[$row][$col])
662 0 0 unless $res
663 0 0 if (ref $res eq 'HASH')
671 2 0 if ($css)
683 0 0 unless $name =~ /\A[A-Za-z0-9_]+(?:::[A-Za-z0-9_]+)*\z/
690 0 0 ref $_[0] eq 'HASH' ? :
730 0 0 ref $self ? :
734 0 0 unless ($all_sets)
752 0 0 if ($detail) { }
763 0 1 if $self->{'_read_style_envs'}++
765 0 1 if ($ENV{'ANSITABLE_COLUMN_STYLES'})
768 0 0 unless ref $ss eq 'HASH'
775 0 0 unless $k ~~ $COLUMN_STYLES
784 0 1 if ($ENV{'ANSITABLE_ROW_STYLES'})
787 0 0 unless ref $ss eq 'HASH'
793 0 0 unless $k ~~ $ROW_STYLES
802 0 1 if ($ENV{'ANSITABLE_CELL_STYLES'})
805 0 0 unless ref $ss eq 'HASH'
808 0 0 unless $cell =~ /^(.+),(.+)$/
817 0 0 unless $k ~~ $CELL_STYLES
835 0 1 if (ref $cf eq 'CODE') { }
0 1 elsif (ref $cf eq 'ARRAY') { }
838 0 0 &looks_like_number($_) ? :
864 0 1 unless $cols->[$i] ~~ $fcols
865 0 1 if $seen{$cols->[$i]}++
871 0 1 if not defined $header_height or $header_height < $wh->[1]
908 0 2 if (ref $rf eq 'CODE') { }
0 2 elsif ($rf) { }
909 0 0 unless &$rf($row, $i)
911 0 0 unless $i ~~ $rf
917 0 2 if $i ~~ $self->{'_row_separators'}
948 0 1 unless $col ~~ $self->{'_draw'}{'fcols'}
955 0 1 if $type
956 0 1 if ($col =~ /^(can|is|has|does)_|\?$/)
965 0 7 if ($_ ~~ \@words)
974 0 1 unless defined $v
975 1 0 unless (&looks_like_number($v))
977 0 1 if ($pass)
979 0 0 if ($col =~ /(pct|percent(?:age))\b|\%/)
988 0 1 if ($type eq 'bool') { }
0 1 elsif ($type eq 'date') { }
0 1 elsif ($type =~ /\A(num|float|int)\z/) { }
993 0 0 $self->{'use_utf8'} ? :
1001 0 0 if (($subtype // '') eq 'pct')
1023 2 1 defined $frownum ? :
1027 3 0 if ($calcw) { }
0 0 elsif ($calch) { }
1029 0 0 if defined $setw and $setw < 0 and $wh->[0] < -$setw
1030 0 3 unless $calch
1031 0 0 if defined $seth and $seth < 0 and $wh->[1] < -$seth
1034 0 0 if defined $seth and $seth < 0 and $h < -$seth
1053 0 1 unless $cols->[$i] ~~ $fcols
1054 0 1 if $seen{$cols->[$i]}++
1057 0 1 if (@fmts) { }
1063 0 0 unless $res->[0] == 200
1087 0 2 unless $cols->[$j] ~~ $fcols
1088 0 2 if $seen{$cols->[$j]}++
1091 2 0 if (defined $fmts)
1097 0 2 unless $res->[0] == 200
1125 0 2 unless $cols->[$j] ~~ $fcols
1126 0 2 if $seen{$cols->[$j]}++
1130 0 2 if $fcol_widths->[$j] < $wh->[0]
1131 2 0 if not defined $frow_heights->[$i] or $frow_heights->[$i] < $wh->[1]
1149 0 1 unless $cols->[$i] ~~ $fcols
1150 0 1 if $seen{$cols->[$i]}++
1152 0 1 if (($self->get_eff_column_style($i, 'wrap') // $self->{'column_wrap'}) // $fcol_detect->[$i]{'wrap'} and defined $fcol_setwidths->[$i] and $fcol_setwidths->[$i] > 0)
1178 1 0 if length $self->{'border_style_obj'}->get_border_char(3, 0)
1181 0 1 unless $cols->[$i] ~~ $fcols
1183 0 1 if ($i < @$cols - 1)
1184 0 0 if $has_vsep
1187 1 0 if length $self->{'border_style_obj'}->get_border_char(3, 2)
1191 1 0 if length $self->{'border_style_obj'}->get_border_char(0, 0)
1197 1 0 if length $self->{'border_style_obj'}->get_border_char(2, 0)
1202 0 2 if $self->_should_draw_row_separator($i)
1204 1 0 if length $self->{'border_style_obj'}->get_border_char(5, 0)
1229 0 1 if defined $fcol_setwidths->[$ci] and $fcol_setwidths->[$ci] > 0
1230 1 0 if $fcol_widths->[$ci] < 30
1232 0 0 unless ($self->get_eff_column_style($ci, 'wrap') // $self->{'column_wrap'}) // $fcol_detect->[$ci]{'wrap'}
1236 1 0 unless %acols
1240 0 0 unless $termw > 0
1242 0 0 unless $excess > 0
1247 0 0 unless $w > 0
1253 0 0 if $reduced >= $excess
1254 0 0 if ($fcol_widths->[$ci] > 30)
1260 0 0 unless $has_reduced
1271 0 0 unless $origw{$ci} != $fcol_widths->[$ci]
1323 0 0 if length $c
1328 18 0 unless $self->use_color
1329 0 0 if $self->{'color_theme_obj'}->get_struct->{'_no_color'}
1336 0 18 if length $c
1346 4 5 if ref $_[0] eq 'HASH'
1350 15 0 if (not $self->{'use_color'}) { }
0 0 elsif ($args) { }
1383 0 3 unless @dlines
1386 0 3 if ($valign =~ /^[Bb]/o) { }
0 3 elsif ($valign =~ /^[MmCc]/o) { }
1402 0 0 $align =~ /^[Rr]/o ? :
3 0 $align =~ /^[Ll]/o ? :
1407 0 3 if ($self->{'use_color'})
1409 0 0 if length $color
1424 0 1 if (defined $self->{'header_fgcolor'}) { }
0 1 elsif (defined $self->{'cell_fgcolor'}) { }
0 1 elsif ($tmp = $self->_color_theme_item_color_to_ansi('header')) { }
0 1 elsif ($tmp = $self->_color_theme_item_color_to_ansi('cell')) { }
1439 0 1 if (defined $self->{'header_bgcolor'}) { }
0 1 elsif (defined $self->{'cell_bgcolor'}) { }
0 1 elsif (defined $self->{'_draw'}{'fcol_detect'}[$i]{'bgcolor'}) { }
0 1 elsif ($tmp = $self->_color_theme_item_color_to_ansi('header_bg', undef, 'bg')) { }
0 1 elsif ($tmp = $self->_color_theme_item_color_to_ansi('cell_bg', undef, 'bg')) { }
1492 0 2 if (defined($tmp = $self->get_eff_cell_style($oy, $x, 'fgcolor'))) { }
0 2 elsif (defined($tmp = $self->get_eff_row_style($oy, 'fgcolor'))) { }
0 2 elsif (defined($tmp = $self->get_eff_column_style($x, 'fgcolor'))) { }
0 2 elsif (defined($tmp = $self->{'cell_fgcolor'})) { }
0 2 elsif (defined($tmp = $self->{'_draw'}{'fcol_detect'}[$x]{'fgcolor'})) { }
0 2 elsif ($tmp = $self->_color_theme_item_color_to_ansi('cell', $args)) { }
1509 0 2 if (defined($tmp = $self->get_eff_cell_style($oy, $x, 'bgcolor'))) { }
0 2 elsif (defined($tmp = $self->get_eff_row_style($oy, 'bgcolor'))) { }
0 2 elsif (defined($tmp = $self->get_eff_column_style($x, 'bgcolor'))) { }
0 2 elsif (defined($tmp = $self->{'cell_bgcolor'})) { }
0 2 elsif (defined($tmp = $self->{'_draw'}{'fcol_detect'}[$x]{'bgcolor'})) { }
0 2 elsif ($tmp = $self->_color_theme_item_color_to_ansi('cell_bg', $args, 'bg')) { }
1576 0 1 unless length $self->{'border_style_obj'}->get_border_char(0, 0)
1583 0 1 if $i < @$fcols - 1
1591 1 0 if ($self->{'show_header'})
1594 1 0 if (@$fcols) { }
1597 0 1 if (defined $seen{$i})
1613 0 1 unless $i == @$fcols - 1
1621 1 0 if ($self->{'show_header'} and length $self->{'border_style_obj'}->get_border_char(2, 0))
1628 0 1 unless $i == @$fcols - 1
1641 2 0 if (@$fcols) { }
1644 0 2 if (defined $seen{$i})
1660 0 2 unless $i == @$fcols - 1
1668 0 2 if ($self->_should_draw_row_separator($r))
1676 0 0 $i == @$fcols - 1 ? :
1686 0 1 unless length $self->{'border_style_obj'}->get_border_char(5, 0)
1693 0 1 unless $i == @$fcols - 1