Branch Coverage

blib/lib/Term/Choose.pm
Criterion Covered Total %
branch 8 630 1.2


line true false branch
21 0 3 if ($^O eq 'MSWin32') { }
33 0 3 if ($? == 255)
34 0 0 if ($^O eq 'MSWin32') { }
0 0 elsif (&TERM_READKEY()) { }
54 0 113 if @_ > 1
56 111 2 if (defined $opt)
57 0 111 if ref $opt ne "HASH"
60 113 37 if defined $opt->{$key}
154 0 0 if ($self->{'ll'}) { }
159 0 0 if ($self->{'color'})
163 0 0 unless ($_)
164 0 0 unless defined $_
165 0 0 unless length $_
167 0 0 if ($self->{'color'})
184 0 0 if ($self->{'ll'}) { }
192 0 0 if $length_elements->[$i] > $longest
214 0 0 if (defined $self->{'plugin'})
217 0 0 if ($clear_choose)
219 0 0 if $up
222 0 0 if (exists $self->{'backup_instance_defaults'})
225 0 0 if ($key eq 'plugin' or $key eq 'backup_instance_defaults') { }
0 0 elsif (exists $instance_defaults->{$key}) { }
250 0 0 if (defined $self->{'skip_items'})
252 0 0 if ($self->{'list'}[$idx] =~ /$self->{'skip_items'}/)
256 0 0 unless (defined $key)
259 0 0 if ref $key ne "ARRAY"
266 0 0 if (defined $self->{'max_cols'} and $self->{'max_cols'} == 1)
269 0 0 if ($self->{'max_height'} and $self->{'max_height'} < $self->{'keep'})
272 0 0 if (length $self->{'footer'} and $self->{'page'} != 2)
275 0 0 if ($self->{'page'} == 2 and not $self->{'clear_screen'})
278 0 0 if ($self->{'max_cols'} and $self->{'layout'} == 1)
281 0 0 unless (defined $self->{'prompt'})
282 0 0 defined $self->{'wantarray'} ? :
284 0 0 if (defined $self->{'margin'})
295 0 0 if (ref $_[0] ne __PACKAGE__)
308 0 0 if @_ < 1 or @_ > 2
309 0 0 if ref $orig_list_ref ne "ARRAY"
310 0 0 if (defined $opt)
311 0 0 if ref $opt ne "HASH"
314 0 0 if defined $opt->{$key}
317 0 0 unless (@$orig_list_ref)
323 0 0 if (defined $self->{'busy_string'})
329 0 0 if ($self->{'mouse'})
332 0 0 if ($^O eq "MSWin32")
333 0 0 $opt->{'codepage_mapping'} ? :
337 0 0 if (defined $self->{'skip_items'})
341 0 0 if (exists $ENV{'TC_RESET_AUTO_UP'})
352 0 0 if ($self->{'term_width'} < $min_term_width or $self->{'term_height'} < $min_term_height)
357 0 0 if ($self->{'pp_count'} > 10000)
364 0 0 unless (defined $key)
371 0 0 if ($new_term_width < $min_term_width or $new_term_height < $min_term_height)
374 0 0 if ($new_term_width != $self->{'term_width'} or $new_term_height != $self->{'term_height'})
375 0 0 if ($self->{'ll'})
379 0 0 if ($new_term_width < $self->{'term_width'})
382 0 0 unless $self->{$opt}
384 0 0 unless length $row
385 0 0 if $self->{'color'}
388 0 0 if $w % ($new_term_width + 1)
391 0 0 if length $self->{'search_info'}
399 0 0 if ($self->{'wantarray'} and @{$self->{'marked'};})
403 0 0 if ($up)
410 0 0 if $key == -1
411 0 0 if $key == 126
412 0 0 if (exists $ENV{'TC_RESET_AUTO_UP'} and $ENV{'TC_RESET_AUTO_UP'} == 0)
413 0 0 if ($key != 10 and $key != 13)
418 0 0 if ($key == 345) { }
0 0 elsif ($key == 346) { }
419 0 0 if $self->{'first_page_row'} - $fast_page * $self->{'avail_height'} >= 0
423 0 0 if $self->{'last_page_row'} + $fast_page * $self->{'avail_height'} <= $#{$$self{"rc2idx"};}
426 0 0 if ($saved_pos and $key != 333 and $key != 2 and $key != 334 and $key != 6)
443 0 0 if ($key == 340 or $key == 106) { }
0 0 elsif ($key == 338 or $key == 107) { }
0 0 elsif ($key == 9 or $key == 9) { }
0 0 elsif ($key == 127 or $key == 8 or $key == 8) { }
0 0 elsif ($key == 339 or $key == 108) { }
0 0 elsif ($key == 337 or $key == 104) { }
0 0 elsif ($key == 333 or $key == 16) { }
0 0 elsif ($key == 334 or $key == 14) { }
0 0 elsif ($key == 336 or $key == 1) { }
0 0 elsif ($key == 335 or $key == 5) { }
0 0 elsif ($key == 113 or $key == 17) { }
0 0 elsif ($key == 3) { }
0 0 elsif ($key == 10 or $key == 13) { }
0 0 elsif ($key == 32) { }
0 0 elsif ($key == 0) { }
0 0 elsif ($key == 6 and $self->{'search'}) { }
444 0 0 if (not $self->{'rc2idx'}[$self->{'pos'}[0] + 1] && $self->{'rc2idx'}[$self->{'pos'}[0] + 1][$self->{'pos'}[1]]) { }
451 0 0 if ($self->{'pos'}[0] <= $self->{'last_page_row'}) { }
458 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
464 0 0 if ($self->{'pos'}[0] == 0) { }
469 0 0 if ($self->{'pos'}[0] >= $self->{'first_page_row'}) { }
476 0 0 if $self->{'first_page_row'} < 0
482 0 0 if ($self->{'pos'}[0] == $#{$$self{'rc2idx'};} and $self->{'pos'}[1] == $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
488 0 0 if ($self->{'pos'}[1] < $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
495 0 0 if ($self->{'pos'}[0] <= $self->{'last_page_row'}) { }
503 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
511 0 0 if ($self->{'pos'}[1] == 0 and $self->{'pos'}[0] == 0) { }
515 0 0 if ($self->{'pos'}[1] > 0) { }
522 0 0 if ($self->{'pos'}[0] >= $self->{'first_page_row'}) { }
530 0 0 if $self->{'first_page_row'} < 0
538 0 0 if ($self->{'pos'}[1] == $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
548 0 0 if ($self->{'pos'}[1] == 0) { }
558 0 0 if ($self->{'first_page_row'} <= 0) { }
564 0 0 if ($saved_pos) { }
576 0 0 if ($self->{'last_page_row'} >= $#{$$self{'rc2idx'};}) { }
583 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
584 0 0 if ($self->{'pos'}[0] + $self->{'avail_height'} > $#{$$self{'rc2idx'};} or $self->{'pos'}[1] > $#{$self->{'rc2idx'}[$self->{'pos'}[0] + $self->{'avail_height'}];}) { }
589 0 0 if ($self->{'pos'}[1] > $#{$self->{'rc2idx'}[$self->{'pos'}[0]];})
600 0 0 if ($self->{'pos'}[1] == 0 and $self->{'pos'}[0] == 0) { }
608 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
613 0 0 if ($self->{'order'} == 1 and $self->{'idx_of_last_col_in_last_row'} < $#{$$self{'rc2idx'}[0];}) { }
614 0 0 if ($self->{'pos'}[0] == $#{$$self{'rc2idx'};} - 1 and $self->{'pos'}[1] == $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
623 0 0 if ($self->{'first_page_row'} == $#{$$self{'rc2idx'};}) { }
634 0 0 if ($self->{'pos'}[0] == $#{$$self{'rc2idx'};} and $self->{'pos'}[1] == $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
658 0 0 if (length $self->{'search_info'})
665 0 0 if (not defined $self->{'wantarray'}) { }
0 0 elsif ($self->{'wantarray'}) { }
670 0 0 if ($self->{'include_highlighted'} == 1) { }
0 0 elsif ($self->{'include_highlighted'} == 2) { }
675 0 0 unless (@$chosen)
679 0 0 if (defined $self->{'meta_items'} and not $self->{'marked'}[$self->{'pos'}[0]][$self->{'pos'}[1]])
681 0 0 if ($meta_item == $list_idx)
689 0 0 $opt_index ? :
692 0 0 $opt_index ? :
698 0 0 if ($self->{'wantarray'}) { }
701 0 0 if (defined $self->{'no_spacebar'} or defined $self->{'meta_items'})
702 0 0 unless $self->{'no_spacebar'}
0 0 unless $self->{'meta_items'}
703 0 0 if ($list_idx == $no_spacebar)
709 0 0 if ($locked) { }
722 0 0 if ($self->{'wantarray'}) { }
728 0 0 if ($self->{'skip_items'})
731 0 0 if (defined $self->{'no_spacebar'})
734 0 0 if (defined $self->{'meta_items'})
746 0 0 if ($self->{'ll'})
751 0 0 if (length $self->{'search_info'})
765 0 0 if ($beep)
778 0 0 if ($#{$$self{'rc2idx'};} > $self->{'avail_height'} - 1) { }
788 0 0 if ($self->{'wantarray'} and defined $self->{'mark'})
791 0 0 if (defined $self->{'default'} and $self->{'default'} <= $#{$$self{"list"};})
794 0 0 if ($self->{'clear_screen'}) { }
801 0 0 if $self->{'margin_top'}
802 0 0 if $self->{'info_rows'}
803 0 0 if $self->{'prompt_rows'}
804 0 0 if (length $self->{'search_info'})
806 0 0 if (print_columns($search_info) > $self->{'term_width'} + 1) { }
814 0 0 if (length $pre_string)
818 0 0 if ($self->{'mouse'})
829 0 0 if ($self->{'margin_right'} or $self->{'col_width'} > $self->{'avail_width'})
839 0 0 if (defined $reduce)
840 0 0 if $self->{'margin_left'}
841 0 0 if $self->{'margin_right'}
843 0 0 if $self->{'margin_left'}
844 0 0 if $self->{'margin_right'}
846 0 0 if ($self->{'max_width'} and $self->{'avail_width'} > $self->{'max_width'}) { }
854 0 0 if $self->{'margin_top'}
855 0 0 if $self->{'info_rows'}
856 0 0 if $self->{'prompt_rows'}
857 0 0 if length $self->{'search_info'}
858 0 0 if $self->{'page'}
859 0 0 if $self->{'bottom_text_rows'}
860 0 0 if $self->{'margin_bottom'}
861 0 0 if ($self->{'avail_height'} < $self->{'keep'})
865 0 0 if ($self->{'max_height'} and $self->{'avail_height'} > $self->{'max_height'})
869 0 0 if (length $self->{'search_info'})
877 0 0 if ($avail_width < 4) { }
0 0 elsif ($avail_width < 9) { }
0 0 elsif ($avail_width < 16) { }
0 0 elsif ($avail_width < 23) { }
0 0 elsif ($avail_width < 30) { }
0 0 elsif ($avail_width < 37) { }
0 0 elsif ($avail_width < 44) { }
0 0 elsif ($avail_width < 51) { }
0 0 elsif ($avail_width < 58) { }
894 0 0 if ($self->{'margin_left'} or $self->{'margin_right'})
896 0 0 if ($tmp_avail_width < $threshold)
902 0 0 if (length $self->{$opt} and defined $$self{'tabs_' . $opt})
910 0 0 if ($self->{$tmp_tabs}[4])
913 0 0 if ($self->{$tmp_tabs}[2] or $self->{$tmp_tabs}[3])
915 0 0 if ($avail_text_width < $threshold)
917 0 0 if ($new_factor < $reduce)
925 0 0 if ($reduce < 1)
936 0 0 if (length $self->{$opt})
940 0 0 if (defined $self->{$tmp_tabs}) { }
941 0 0 if $self->{$tmp_tabs}[0]
942 0 0 if $self->{$tmp_tabs}[1]
943 0 0 if (not defined $reduce) { }
0 0 elsif ($reduce == 0) { }
948 0 0 if $self->{$tmp_tabs}[2]
949 0 0 if $self->{$tmp_tabs}[3]
952 0 0 if $self->{$tmp_tabs}[2]
953 0 0 if $self->{$tmp_tabs}[3]
955 0 0 if ($self->{$tmp_tabs}[4] and $self->{$tmp_tabs}[4] < $self->{'term_width'} + 1 - ($l_margin + $r_margin))
975 0 0 if ($max_width) { }
983 0 0 if ($init > $width - 5 or $subseq > $width - 5)
990 0 0 if ($initialize_text_rows) { }
1007 0 0 if ($self->{'layout'} == 2) { }
1008 0 0 if ($keep > @{$self->{'list'};})
1015 0 0 if ($keep <= $self->{'avail_height'})
1018 0 0 if ($self->{'margin_top'} or $self->{'margin_bottom'})
1024 0 0 if ($self->{$margin_type})
1027 0 0 if $self->{'avail_height'} == $keep
1030 0 0 if $prev_avail_height == $self->{'avail_height'}
1033 0 0 if ($keep <= $self->{'avail_height'})
1036 0 0 if ($self->{'max_width'} or $self->{'tabs_with_max_width'})
1040 0 0 if ($self->{'max_width'})
1047 0 0 if (defined $self->{$tmp_tabs} and $self->{$tmp_tabs}[4])
1054 0 0 if ($increase->{'main'} > 0)
1055 0 0 if ($s == $steps) { }
1065 0 0 if ($increase->{$opt} > 0)
1066 0 0 if ($s == $steps) { }
1076 0 0 if $keep <= $self->{'avail_height'}
1081 0 0 if (defined $self->{$tmp_tabs} and $self->{$tmp_tabs}[4])
1086 0 0 if ($keep <= $self->{'avail_height'})
1089 0 0 if ($self->{'margin_right'} or $self->{'margin_left'} or $self->{'tabs_width_horizontal_margin'})
1095 0 0 if ($reduce == 0) { }
1096 0 0 $self->{'margin_right'} ? :
1097 0 0 $self->{'margin_left'} ? :
1100 0 0 if $self->{'margin_right'}
1101 0 0 if $self->{'margin_left'}
1107 0 0 if $keep <= $self->{'avail_height'}
1110 0 0 if ($keep <= $self->{'avail_height'})
1113 0 0 if ($self->{'info_rows'})
1116 0 0 if (@{$self->{'info_rows'};} >= $keep - $self->{'avail_height'}) { }
1123 0 0 if ($keep <= $self->{'avail_height'})
1126 0 0 if ($self->{'bottom_text_rows'})
1128 0 0 if (@{$self->{'bottom_text_rows'};} > $keep - $self->{'avail_height'}) { }
1132 0 0 if (defined $self->{'tmp_tabs_bottom_text'}) { }
1140 0 0 if ($avail_w >= $ellipsis_w)
1152 0 0 if ($keep <= $self->{'avail_height'})
1155 0 0 if ($self->{'prompt_rows'})
1156 0 0 if (@{$self->{'prompt_rows'};} > $keep - $self->{'avail_height'}) { }
1160 0 0 if ($self->{'avail_height'} + @{$self->{'prompt_rows'};} > 4) { }
1170 0 0 if ($keep <= $self->{'avail_height'})
1173 0 0 if (length $self->{'search_info'})
1174 0 0 if ($self->{'avail_height'} > 2) { }
1181 0 0 if ($keep <= $self->{'avail_height'})
1184 0 0 if ($self->{'page'})
1206 0 0 if ($row_w >= $self->{'avail_width'})
1212 0 0 if (@{$self->{'list'};} % $count)
1215 0 0 if ($keep > $rows)
1225 0 0 if ($self->{'layout'} <= 1 and not $self->{'ll'} and not $self->{'max_cols'})
1229 0 0 if ($firstrow_width - $self->{'pad'} > $self->{'avail_width'})
1236 0 0 if ($all_in_first_row) { }
0 0 elsif ($self->{'col_width'} >= $self->{'avail_width'}) { }
1254 0 0 if ($self->{'current_layout'} == -1) { }
0 0 elsif ($self->{'current_layout'} == 2) { }
1267 0 0 if ($self->{'current_layout'} == 1)
1269 0 0 if @{$self->{'list'};} % $self->{'avail_height'}
1271 0 0 if ($tmc < $tmp_avail_width)
1278 0 0 if ($self->{'max_cols'} and $cols_per_row > $self->{'max_cols'})
1281 0 0 if $cols_per_row < 1
1283 0 0 if ($self->{'order'} == 1) { }
1289 0 0 if $c > $self->{'idx_of_last_col_in_last_row'}
1297 0 0 if $r == $rows - 1 and $c > $self->{'idx_of_last_col_in_last_row'}
1306 0 0 if $end > $#{$$self{"list"};}
1311 0 0 if $end > $#{$$self{"list"};}
1321 0 0 if (exists $self->{'footer_fmt'})
1325 0 0 if ($self->{'page'} == 0) { }
0 0 elsif ($self->{'page'} == 1 and $pp_total == 1) { }
1334 0 0 if (defined $self->{'footer'})
1337 0 0 if (print_columns(sprintf($self->{'footer_fmt'}, $pp_total)) > $self->{'avail_width'})
1339 0 0 if (length sprintf($self->{'footer_fmt'}, $pp_total) > $self->{'avail_width'})
1340 0 0 if $pp_total_width > $self->{'avail_width'}
1344 0 0 if ($self->{'margin_left'})
1355 0 0 if ($self->{'current_layout'} == 2)
1357 0 0 if ($list_idx > $last_list_idx)
1366 0 0 if ($self->{'order'} == 0) { }
0 0 elsif ($self->{'order'} == 1) { }
1368 0 0 if ($list_idx > $last_list_idx)
1383 0 0 if ($list_idx > $last_list_idx)
1386 0 0 if ($list_idx <= $last_list_idx_in_cols_full) { }
1403 0 0 if ($self->{'current_layout'} == 2) { }
1409 0 0 if ($list_idx == $self->{'rc2idx'}[$i][$j])
1418 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
1425 0 0 if ($self->{'order'} == 1) { }
1428 0 0 if ($self->{'marked'}[$row][$col])
1437 0 0 if ($self->{'marked'}[$row][$col])
1453 0 0 if ($self->{'footer_fmt'} or $self->{'pp_count'} > 1) { }
1461 0 0 if ($self->{'footer_fmt'})
1465 0 0 if ($self->{'bottom_text_rows'})
1469 0 0 if ($self->{'margin_bottom'})
1474 0 0 if (@post_rows)
1485 0 0 if ($#{$$self{"rc2idx"}[$row];})
1490 0 0 if ($left_margin) { }
1499 0 0 if ($self->{'margin_left'})
1509 0 0 $self->{'marked'}[$row][$col] ? :
0 0 $is_current_pos ? :
1511 0 0 if ($self->{'ll'}) { }
1512 0 0 if ($self->{'color'}) { }
1514 0 0 if ($emphasised)
1515 0 0 if ($is_current_pos and $self->{'color'} == 1) { }
1528 0 0 if ($emphasised) { }
1537 0 0 $self->{'current_layout'} == -1 ? :
1538 0 0 if ($self->{'color'}) { }
1540 0 0 if (not $self->{'orig_list'}[$idx]) { }
1541 0 0 if (not defined $self->{'orig_list'}[$idx]) { }
0 0 elsif (not length $self->{'orig_list'}[$idx]) { }
1551 0 0 if ($emphasised)
1557 0 0 if ($is_current_pos and $self->{'color'} == 1)
1563 0 0 if (@color)
1565 0 0 unless ($emphasised)
1572 0 0 if ($emphasised)
1584 0 0 if ($self->{'current_layout'} == -1) { }
1586 0 0 if ($col > 0)
1605 0 0 if ($self->{'width_elements'}[$idx] < $self->{'col_width'}) { }
0 0 elsif ($self->{'width_elements'}[$idx] > $self->{'col_width'}) { }
1606 0 0 if ($self->{'alignment'} == 0) { }
0 0 elsif ($self->{'alignment'} == 1) { }
0 0 elsif ($self->{'alignment'} == 2) { }
1619 0 0 if ($self->{'col_width'} > 6) { }
1635 0 0 if ($newrow > $self->{'i_row'}) { }
0 0 elsif ($newrow < $self->{'i_row'}) { }
1643 0 0 if ($newcol > $self->{'i_col'}) { }
0 0 elsif ($newcol < $self->{'i_col'}) { }