Branch Coverage

blib/lib/Term/Choose.pm
Criterion Covered Total %
branch 8 542 1.4


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 115 if @_ > 1
56 113 2 if (defined $opt)
57 0 113 if ref $opt ne "HASH"
60 115 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}) { }
242 0 0 if (defined $self->{'skip_items'})
244 0 0 if ($self->{'list'}[$idx] =~ /$self->{'skip_items'}/)
248 0 0 unless (defined $key)
251 0 0 if ref $key ne "ARRAY"
258 0 0 if (defined $self->{'max_cols'} and $self->{'max_cols'} == 1)
261 0 0 if (length $self->{'footer'} and $self->{'page'} != 2)
264 0 0 if ($self->{'page'} == 2 and not $self->{'clear_screen'})
267 0 0 if ($self->{'max_cols'} and $self->{'layout'} == 1)
270 0 0 unless (defined $self->{'prompt'})
271 0 0 defined $self->{'wantarray'} ? :
273 0 0 if (defined $self->{'margin'})
275 0 0 unless (defined $self->{'tabs_prompt'})
278 0 0 unless (defined $self->{'tabs_info'})
281 0 0 if (not defined $self->{'tabs_bottom_text'})
289 0 0 if (ref $_[0] ne __PACKAGE__)
302 0 0 if @_ < 1 or @_ > 2
303 0 0 if ref $orig_list_ref ne "ARRAY"
304 0 0 if (defined $opt)
305 0 0 if ref $opt ne "HASH"
308 0 0 if defined $opt->{$key}
311 0 0 unless (@$orig_list_ref)
317 0 0 if (defined $self->{'busy_string'})
323 0 0 if ($self->{'mouse'})
326 0 0 if ($^O eq "MSWin32")
327 0 0 $opt->{'codepage_mapping'} ? :
331 0 0 if (defined $self->{'skip_items'})
335 0 0 if (exists $ENV{'TC_RESET_AUTO_UP'})
346 0 0 if ($self->{'pp_count'} > 10000)
353 0 0 unless (defined $key)
360 0 0 if ($new_width != $self->{'term_width'} or $new_height != $self->{'term_height'})
361 0 0 if ($self->{'ll'})
365 0 0 if ($new_width < $self->{'term_width'})
368 0 0 unless $self->{$opt}
370 0 0 unless length $row
371 0 0 if $self->{'color'}
374 0 0 if $w % ($new_width + 1)
377 0 0 if length $self->{'search_info'}
385 0 0 if ($self->{'wantarray'} and @{$self->{'marked'};})
389 0 0 if ($up)
396 0 0 if $key == -1
397 0 0 if $key == 126
398 0 0 if (exists $ENV{'TC_RESET_AUTO_UP'} and $ENV{'TC_RESET_AUTO_UP'} == 0)
399 0 0 if ($key != 10 and $key != 13)
404 0 0 if ($key == 345) { }
0 0 elsif ($key == 346) { }
405 0 0 if $self->{'first_page_row'} - $fast_page * $self->{'avail_height'} >= 0
409 0 0 if $self->{'last_page_row'} + $fast_page * $self->{'avail_height'} <= $#{$$self{"rc2idx"};}
412 0 0 if ($saved_pos and $key != 333 and $key != 2 and $key != 334 and $key != 6)
429 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'}) { }
430 0 0 if (not $self->{'rc2idx'}[$self->{'pos'}[0] + 1] && $self->{'rc2idx'}[$self->{'pos'}[0] + 1][$self->{'pos'}[1]]) { }
437 0 0 if ($self->{'pos'}[0] <= $self->{'last_page_row'}) { }
444 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
450 0 0 if ($self->{'pos'}[0] == 0) { }
455 0 0 if ($self->{'pos'}[0] >= $self->{'first_page_row'}) { }
462 0 0 if $self->{'first_page_row'} < 0
468 0 0 if ($self->{'pos'}[0] == $#{$$self{'rc2idx'};} and $self->{'pos'}[1] == $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
474 0 0 if ($self->{'pos'}[1] < $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
481 0 0 if ($self->{'pos'}[0] <= $self->{'last_page_row'}) { }
489 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
497 0 0 if ($self->{'pos'}[1] == 0 and $self->{'pos'}[0] == 0) { }
501 0 0 if ($self->{'pos'}[1] > 0) { }
508 0 0 if ($self->{'pos'}[0] >= $self->{'first_page_row'}) { }
516 0 0 if $self->{'first_page_row'} < 0
524 0 0 if ($self->{'pos'}[1] == $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
534 0 0 if ($self->{'pos'}[1] == 0) { }
544 0 0 if ($self->{'first_page_row'} <= 0) { }
550 0 0 if ($saved_pos) { }
562 0 0 if ($self->{'last_page_row'} >= $#{$$self{'rc2idx'};}) { }
569 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
570 0 0 if ($self->{'pos'}[0] + $self->{'avail_height'} > $#{$$self{'rc2idx'};} or $self->{'pos'}[1] > $#{$self->{'rc2idx'}[$self->{'pos'}[0] + $self->{'avail_height'}];}) { }
575 0 0 if ($self->{'pos'}[1] > $#{$self->{'rc2idx'}[$self->{'pos'}[0]];})
586 0 0 if ($self->{'pos'}[1] == 0 and $self->{'pos'}[0] == 0) { }
594 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
599 0 0 if ($self->{'order'} == 1 and $self->{'idx_of_last_col_in_last_row'} < $#{$$self{'rc2idx'}[0];}) { }
600 0 0 if ($self->{'pos'}[0] == $#{$$self{'rc2idx'};} - 1 and $self->{'pos'}[1] == $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
609 0 0 if ($self->{'first_page_row'} == $#{$$self{'rc2idx'};}) { }
620 0 0 if ($self->{'pos'}[0] == $#{$$self{'rc2idx'};} and $self->{'pos'}[1] == $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
644 0 0 if (length $self->{'search_info'})
651 0 0 if (not defined $self->{'wantarray'}) { }
0 0 elsif ($self->{'wantarray'}) { }
656 0 0 if ($self->{'include_highlighted'} == 1) { }
0 0 elsif ($self->{'include_highlighted'} == 2) { }
661 0 0 unless (@$chosen)
665 0 0 if (defined $self->{'meta_items'} and not $self->{'marked'}[$self->{'pos'}[0]][$self->{'pos'}[1]])
667 0 0 if ($meta_item == $list_idx)
675 0 0 $opt_index ? :
678 0 0 $opt_index ? :
684 0 0 if ($self->{'wantarray'}) { }
687 0 0 if (defined $self->{'no_spacebar'} or defined $self->{'meta_items'})
688 0 0 unless $self->{'no_spacebar'}
0 0 unless $self->{'meta_items'}
689 0 0 if ($list_idx == $no_spacebar)
695 0 0 if ($locked) { }
708 0 0 if ($self->{'wantarray'}) { }
714 0 0 if ($self->{'skip_items'})
717 0 0 if (defined $self->{'no_spacebar'})
720 0 0 if (defined $self->{'meta_items'})
732 0 0 if ($self->{'ll'})
737 0 0 if (length $self->{'search_info'})
751 0 0 if ($beep)
760 0 0 if $self->{'max_width'} and $info_w > $self->{'max_width'}
763 0 0 if (length $self->{$opt})
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'})
805 0 0 $self->{'margin_left'} ? :
808 0 0 if (length $pre_string)
812 0 0 if ($self->{'mouse'})
822 0 0 if ($self->{'margin_right'} or $self->{'col_width'} > $self->{'avail_width'})
828 0 0 if $self->{'margin_left'}
829 0 0 if $self->{'margin_right'}
830 0 0 if $self->{'max_width'} and $self->{'avail_width'} > $self->{'max_width'}
831 0 0 if $self->{'avail_width'} < 1
835 0 0 if $self->{'margin_top'}
836 0 0 if $self->{'info_rows'}
837 0 0 if $self->{'prompt_rows'}
838 0 0 if length $self->{'search_info'}
839 0 0 if $self->{'page'}
840 0 0 if $self->{'bottom_text_rows'}
841 0 0 if $self->{'margin_bottom'}
842 0 0 if $self->{'max_height'} and $self->{'avail_height'} > $self->{'max_height'}
843 0 0 if ($self->{'avail_height'} < $self->{'keep'})
847 0 0 if (length $self->{'search_info'})
856 0 0 if ($self->{'layout'} == 2) { }
857 0 0 if ($keep > @{$self->{'list'};})
864 0 0 if ($keep <= $self->{'avail_height'})
867 0 0 if ($self->{'margin_top'} or $self->{'margin_bottom'})
873 0 0 if ($self->{$margin_type})
876 0 0 if $self->{'avail_height'} == $keep
879 0 0 if $prev_avail_height == $self->{'avail_height'}
882 0 0 if ($keep <= $self->{'avail_height'})
885 0 0 if ($self->{'margin_right'} or $self->{'margin_left'})
888 0 0 $self->{'margin_right'} ? :
889 0 0 $self->{'margin_left'} ? :
892 0 0 if (length $self->{$opt})
895 0 0 defined $self->{$ts}[0] && $self->{$ts}[0] < $self->{'margin_left'} ? :
896 0 0 defined $self->{$ts}[1] && $self->{$ts}[1] < $self->{'margin_left'} ? :
897 0 0 defined $self->{$ts}[2] && $self->{$ts}[2] < $self->{'margin_right'} ? :
910 0 0 if ($keep <= $self->{'avail_height'})
915 0 0 if ($self->{'term_height'} > $keep)
919 0 0 if (length $self->{'search_info'})
920 0 0 if ($available_rows) { }
927 0 0 if ($self->{'page'})
928 0 0 if ($available_rows) { }
935 0 0 if ($self->{'prompt_rows'})
936 0 0 if ($available_rows) { }
0 0 elsif ($self->{'avail_height'} > 4) { }
937 0 0 if (@{$self->{'prompt_rows'};} > $available_rows) { }
953 0 0 unless ($available_rows)
958 0 0 if ($self->{'bottom_text_rows'})
959 0 0 if (@{$self->{'bottom_text_rows'};} > $available_rows) { }
964 0 0 if ($avail_w >= $ellipsis_w)
995 0 0 if ($row_w >= $self->{'avail_width'})
1001 0 0 if (@{$self->{'list'};} % $count)
1004 0 0 if ($keep > $rows)
1014 0 0 if ($self->{'layout'} <= 1 and not $self->{'ll'} and not $self->{'max_cols'})
1018 0 0 if ($firstrow_width - $self->{'pad'} > $self->{'avail_width'})
1025 0 0 if ($all_in_first_row) { }
0 0 elsif ($self->{'col_width'} >= $self->{'avail_width'}) { }
1043 0 0 if ($self->{'current_layout'} == -1) { }
0 0 elsif ($self->{'current_layout'} == 2) { }
1056 0 0 if ($self->{'current_layout'} == 1)
1058 0 0 if @{$self->{'list'};} % $self->{'avail_height'}
1060 0 0 if ($tmc < $tmp_avail_width)
1067 0 0 if ($self->{'max_cols'} and $cols_per_row > $self->{'max_cols'})
1070 0 0 if $cols_per_row < 1
1072 0 0 if ($self->{'order'} == 1) { }
1078 0 0 if $c > $self->{'idx_of_last_col_in_last_row'}
1086 0 0 if $r == $rows - 1 and $c > $self->{'idx_of_last_col_in_last_row'}
1095 0 0 if $end > $#{$$self{"list"};}
1100 0 0 if $end > $#{$$self{"list"};}
1110 0 0 if (exists $self->{'footer_fmt'})
1114 0 0 if ($self->{'page'} == 0) { }
0 0 elsif ($self->{'page'} == 1 and $pp_total == 1) { }
1123 0 0 if (defined $self->{'footer'})
1126 0 0 if (print_columns(sprintf($self->{'footer_fmt'}, $pp_total)) > $self->{'avail_width'})
1128 0 0 if (length sprintf($self->{'footer_fmt'}, $pp_total) > $self->{'avail_width'})
1129 0 0 if $pp_total_width > $self->{'avail_width'}
1133 0 0 if ($self->{'margin_left'})
1144 0 0 if ($self->{'current_layout'} == 2)
1146 0 0 if ($list_idx > $last_list_idx)
1155 0 0 if ($self->{'order'} == 0) { }
0 0 elsif ($self->{'order'} == 1) { }
1157 0 0 if ($list_idx > $last_list_idx)
1172 0 0 if ($list_idx > $last_list_idx)
1175 0 0 if ($list_idx < $last_list_idx_in_cols_full) { }
1192 0 0 if ($self->{'current_layout'} == 2) { }
1198 0 0 if ($list_idx == $self->{'rc2idx'}[$i][$j])
1207 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
1214 0 0 if ($self->{'order'} == 1) { }
1217 0 0 if ($self->{'marked'}[$row][$col])
1226 0 0 if ($self->{'marked'}[$row][$col])
1242 0 0 if ($self->{'footer_fmt'} or $self->{'pp_count'} > 1) { }
1250 0 0 if ($self->{'footer_fmt'})
1254 0 0 if ($self->{'bottom_text_rows'})
1258 0 0 if ($self->{'margin_bottom'})
1263 0 0 if (@post_rows)
1274 0 0 if ($#{$$self{"rc2idx"}[$row];})
1279 0 0 if ($left_margin) { }
1288 0 0 if ($self->{'margin_left'})
1298 0 0 $self->{'marked'}[$row][$col] ? :
0 0 $is_current_pos ? :
1300 0 0 if ($self->{'ll'}) { }
1301 0 0 if ($self->{'color'}) { }
1303 0 0 if ($emphasised)
1304 0 0 if ($is_current_pos and $self->{'color'} == 1) { }
1317 0 0 if ($emphasised) { }
1326 0 0 $self->{'current_layout'} == -1 ? :
1327 0 0 if ($self->{'color'}) { }
1329 0 0 if (not $self->{'orig_list'}[$idx]) { }
1330 0 0 if (not defined $self->{'orig_list'}[$idx]) { }
0 0 elsif (not length $self->{'orig_list'}[$idx]) { }
1340 0 0 if ($emphasised)
1346 0 0 if ($is_current_pos and $self->{'color'} == 1)
1352 0 0 if (@color)
1354 0 0 unless ($emphasised)
1361 0 0 if ($emphasised)
1373 0 0 if ($self->{'current_layout'} == -1) { }
1375 0 0 if ($col > 0)
1394 0 0 if ($self->{'width_elements'}[$idx] < $self->{'col_width'}) { }
0 0 elsif ($self->{'width_elements'}[$idx] > $self->{'col_width'}) { }
1395 0 0 if ($self->{'alignment'} == 0) { }
0 0 elsif ($self->{'alignment'} == 1) { }
0 0 elsif ($self->{'alignment'} == 2) { }
1408 0 0 if ($self->{'col_width'} > 6) { }
1424 0 0 if ($newrow > $self->{'i_row'}) { }
0 0 elsif ($newrow < $self->{'i_row'}) { }
1432 0 0 if ($newcol > $self->{'i_col'}) { }
0 0 elsif ($newcol < $self->{'i_col'}) { }