Branch Coverage

blib/lib/Term/Table2.pm
Criterion Covered Total %
branch 106 106 100.0


line true false branch
36 1 38 $@ ? :
194 2 208 if $self->{'end_of_table'} and not @{$self->{':row_lines'};}
196 72 136 unless @{$self->{':row_lines'};} and $self->{':line_on_page'}
198 13 195 if $self->{':line_on_page'} == $self->{':lines_per_page'}
201 69 139 unless @{$self->{':row_lines'};}
239 9 2 ref $self->{'rows'} eq 'ARRAY' ? :
256 133 168 if exists $params{$option}
265 22 142 if $self->{':split_offset'}
269 37 127 if $self->{'broad_row'} == 2 and $line_too_long
271 22 105 if $line_too_long
286 86 203 if (Term::Table2::length($field) > $column_width) { }
288 1 85 $broad_flags->[$column_no] == 0 ? :
306 68 2 if (@row)
316 59 17 if (not @{$self->{':row_lines'};} and @{$self->_get_next_row;})
324 21 55 if ref $self->{'rows'} eq 'ARRAY' && $self->{'current_row'} == 1 || !$self->{':line_on_page'} and not $self->{'end_of_table'}
326 15 10 if ($self->{':end_of_chunk'} || $self->{'separate_rows'} && $self->{':line_on_page'} + @{$self->{':row_lines'};} < $self->{'page_height'} - 1 and not $self->{':separating_added'})
339 12 60 if ($self->{'end_of_table'} or ref $self->{'rows'} eq 'ARRAY' and not $self->_get_next_row_from_array or ref $self->{'rows'} eq 'CODE' and not $self->_get_next_row_from_callback) { }
358 12 57 if ($current_row > $#{$$self{'rows'};})
359 10 2 if ($self->{'broad_row'} != 1 or $self->{':split_offset'} + $self->{'table_width'} >= $self->{':total_width'})
379 3 5 unless (defined $self->{':number_of_columns'})
380 2 1 ref $row eq 'ARRAY' ? :
381 1 2 if ref $row ne 'ARRAY'
385 2 5 unless (defined $row)
392 1 4 if ref $row ne 'ARRAY'
393 1 3 if scalar @$row != $number_of_columns
396 1 4 if ref $row->[$_]
410 10 3 unless ref $self->{'pad'}
415 1 12 if $self->{'table_width'} < 2 + &min(@{$$self{'pad'};})
418 2 31 $self->{'column_width'}[$_] == 0 ? :
423 10 2 if (@{$self->{':header_lines'};})
429 10 2 $self->{'broad_row'} == 2 ? :
437 10 2 if (@{$self->{':header_lines'};})
440 1 9 if $self->{'page_height'} < $page_height
451 1 5 unless _is_int($flag)
458 1 6 unless _is_int($flag)
471 1 1 ref $flag ? :
477 1 11 ref $width ? :
483 1 9 ref $width ? :
501 181 2 unless not defined $_
513 1 1 @{$self->{'header'};} ? :
521 2 67 if $#$row >= $self->{':number_of_columns'}
534 66 55 if (ref {broad_column => {default => [2], optional => 1}, broad_header => {default => [2], optional => 1}, broad_row => {default => 2, optional => 1}, collapse => {default => [0], optional => 1}, column_width => {default => [0], optional => 1}, header => {default => [()], optional => 1}, pad => {default => 1, optional => 1}, page_height => {default => sub { return (GetTerminalSize())[1]; } , optional => 1}, rows => {default => [()], optional => 1}, separate_rows => {default => 0, optional => 1}, table_width => {default => sub { return (GetTerminalSize())[0]; } , optional => 1}}->{$option}{'default'} eq 'ARRAY') { }
536 10 56 defined $self->{$option} && !ref($self->{$option}) ? :
537 44 22 unless ref $self->{$option}
538 22 44 if $option eq 'header' or $option eq 'rows'
543 2 28 ref $default eq 'CODE' ? :
30 25 unless defined $self->{$option}
557 2 30 if ($self->{'collapse'}[$column_no] and not $column_width) { }
567 1 31 if $self->{'broad_row'} == 0 and $table_width >= $self->{'table_width'}
571 2 10 if $table_width == 1
589 9 3 ref $params{'rows'} eq 'ARRAY' ? :
597 8 2 @{$self->{'rows'};} ? :
619 1 10 if exists $params{'header'} and exists $params{'rows'} and @{$params{'header'};} < $self->{':number_of_columns'}