Branch Coverage

blib/lib/Term/Choose.pm
Criterion Covered Total %
branch 8 452 1.7


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}
150 0 0 if ($self->{'ll'}) { }
155 0 0 if ($self->{'color'})
159 0 0 unless ($_)
160 0 0 unless defined $_
161 0 0 unless length $_
163 0 0 if ($self->{'color'})
180 0 0 if ($self->{'ll'}) { }
188 0 0 if $length_elements->[$i] > $longest
209 0 0 if (defined $self->{'plugin'})
212 0 0 if ($clear_choose)
214 0 0 if $up
217 0 0 if (exists $self->{'backup_instance_defaults'})
220 0 0 if ($key eq 'plugin' or $key eq 'backup_instance_defaults') { }
0 0 elsif (exists $instance_defaults->{$key}) { }
237 0 0 if (defined $self->{'skip_items'})
239 0 0 if ($self->{'list'}[$idx] =~ /$self->{'skip_items'}/)
243 0 0 unless (defined $key)
246 0 0 if ref $key ne "ARRAY"
253 0 0 if (defined $self->{'max_cols'} and $self->{'max_cols'} == 1)
256 0 0 if (length $self->{'footer'} and $self->{'page'} != 2)
259 0 0 if ($self->{'page'} == 2 and not $self->{'clear_screen'})
262 0 0 if ($self->{'max_cols'} and $self->{'layout'} == 1)
265 0 0 unless (defined $self->{'prompt'})
266 0 0 defined $self->{'wantarray'} ? :
268 0 0 if (defined $self->{'margin'})
270 0 0 unless (defined $self->{'tabs_prompt'})
273 0 0 if (not defined $self->{'tabs_info'})
281 0 0 if (ref $_[0] ne "Term::Choose")
294 0 0 if @_ < 1 or @_ > 2
295 0 0 if ref $orig_list_ref ne "ARRAY"
296 0 0 if (defined $opt)
297 0 0 if ref $opt ne "HASH"
300 0 0 if defined $opt->{$key}
303 0 0 unless (@$orig_list_ref)
309 0 0 if (defined $self->{'busy_string'})
315 0 0 if ($self->{'mouse'})
318 0 0 if ($^O eq "MSWin32")
319 0 0 $opt->{'codepage_mapping'} ? :
323 0 0 if (defined $self->{'skip_items'})
327 0 0 if (exists $ENV{'TC_RESET_AUTO_UP'})
338 0 0 if ($self->{'pp_count'} > 10000)
345 0 0 unless (defined $key)
352 0 0 if ($new_width != $self->{'term_width'} or $new_height != $self->{'term_height'})
353 0 0 if ($self->{'ll'})
360 0 0 if ($self->{'wantarray'} and @{$self->{'marked'};})
364 0 0 if $up
369 0 0 if $key == -1
370 0 0 if $key == 126
371 0 0 if (exists $ENV{'TC_RESET_AUTO_UP'} and $ENV{'TC_RESET_AUTO_UP'} == 0)
372 0 0 if ($key != 10 and $key != 13)
377 0 0 if ($key == 345) { }
0 0 elsif ($key == 346) { }
378 0 0 if $self->{'first_page_row'} - $fast_page * $self->{'avail_height'} >= 0
382 0 0 if $self->{'last_page_row'} + $fast_page * $self->{'avail_height'} <= $#{$$self{"rc2idx"};}
385 0 0 if ($saved_pos and $key != 333 and $key != 2 and $key != 334 and $key != 6)
402 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'}) { }
403 0 0 if (not $self->{'rc2idx'}[$self->{'pos'}[0] + 1] && $self->{'rc2idx'}[$self->{'pos'}[0] + 1][$self->{'pos'}[1]]) { }
410 0 0 if ($self->{'pos'}[0] <= $self->{'last_page_row'}) { }
417 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
423 0 0 if ($self->{'pos'}[0] == 0) { }
428 0 0 if ($self->{'pos'}[0] >= $self->{'first_page_row'}) { }
435 0 0 if $self->{'first_page_row'} < 0
441 0 0 if ($self->{'pos'}[0] == $#{$$self{'rc2idx'};} and $self->{'pos'}[1] == $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
447 0 0 if ($self->{'pos'}[1] < $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
454 0 0 if ($self->{'pos'}[0] <= $self->{'last_page_row'}) { }
462 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
470 0 0 if ($self->{'pos'}[1] == 0 and $self->{'pos'}[0] == 0) { }
474 0 0 if ($self->{'pos'}[1] > 0) { }
481 0 0 if ($self->{'pos'}[0] >= $self->{'first_page_row'}) { }
489 0 0 if $self->{'first_page_row'} < 0
497 0 0 if ($self->{'pos'}[1] == $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
507 0 0 if ($self->{'pos'}[1] == 0) { }
517 0 0 if ($self->{'first_page_row'} <= 0) { }
523 0 0 if ($saved_pos) { }
535 0 0 if ($self->{'last_page_row'} >= $#{$$self{'rc2idx'};}) { }
542 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
543 0 0 if ($self->{'pos'}[0] + $self->{'avail_height'} > $#{$$self{'rc2idx'};} or $self->{'pos'}[1] > $#{$self->{'rc2idx'}[$self->{'pos'}[0] + $self->{'avail_height'}];}) { }
548 0 0 if ($self->{'pos'}[1] > $#{$self->{'rc2idx'}[$self->{'pos'}[0]];})
559 0 0 if ($self->{'pos'}[1] == 0 and $self->{'pos'}[0] == 0) { }
567 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
572 0 0 if ($self->{'order'} == 1 and $self->{'idx_of_last_col_in_last_row'} < $#{$$self{'rc2idx'}[0];}) { }
573 0 0 if ($self->{'pos'}[0] == $#{$$self{'rc2idx'};} - 1 and $self->{'pos'}[1] == $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
582 0 0 if ($self->{'first_page_row'} == $#{$$self{'rc2idx'};}) { }
593 0 0 if ($self->{'pos'}[0] == $#{$$self{'rc2idx'};} and $self->{'pos'}[1] == $#{$self->{'rc2idx'}[$self->{'pos'}[0]];}) { }
617 0 0 if (length $self->{'search_info'})
624 0 0 if (not defined $self->{'wantarray'}) { }
0 0 elsif ($self->{'wantarray'}) { }
629 0 0 if ($self->{'include_highlighted'} == 1) { }
0 0 elsif ($self->{'include_highlighted'} == 2) { }
634 0 0 unless (@$chosen)
638 0 0 if (defined $self->{'meta_items'} and not $self->{'marked'}[$self->{'pos'}[0]][$self->{'pos'}[1]])
640 0 0 if ($meta_item == $list_idx)
648 0 0 $opt_index ? :
651 0 0 $opt_index ? :
657 0 0 if ($self->{'wantarray'}) { }
660 0 0 if (defined $self->{'no_spacebar'} or defined $self->{'meta_items'})
661 0 0 unless $self->{'no_spacebar'}
0 0 unless $self->{'meta_items'}
662 0 0 if ($list_idx == $no_spacebar)
668 0 0 if ($locked) { }
681 0 0 if ($self->{'wantarray'}) { }
687 0 0 if ($self->{'skip_items'})
690 0 0 if (defined $self->{'no_spacebar'})
693 0 0 if (defined $self->{'meta_items'})
705 0 0 if ($self->{'ll'})
710 0 0 if (length $self->{'search_info'})
724 0 0 if ($beep)
733 0 0 if ($^O ne "MSWin32" and $^O ne "cygwin")
736 0 0 if ($self->{'max_width'} and $info_w > $self->{'max_width'})
740 0 0 if ($self->{'margin_top'})
743 0 0 if (length $self->{'info'})
752 0 0 if (length $self->{'prompt'})
761 0 0 if (length $self->{'search_info'})
762 0 0 $self->{'margin_left'} ? :
765 0 0 unless ($self->{'count_prompt_lines'})
776 0 0 if (exists $self->{'footer_fmt'})
780 0 0 if ($self->{'page'} == 0) { }
0 0 elsif ($self->{'page'} == 1 and $pp_total == 1) { }
789 0 0 if (defined $self->{'footer'})
792 0 0 if (print_columns(sprintf($self->{'footer_fmt'}, $pp_total)) > $self->{'avail_width'})
794 0 0 if (length sprintf($self->{'footer_fmt'}, $pp_total) > $self->{'avail_width'})
795 0 0 if $pp_total_width > $self->{'avail_width'}
808 0 0 if ($list_idx == $self->{'rc2idx'}[$i][$j])
816 0 0 if $self->{'last_page_row'} > $#{$$self{"rc2idx"};}
828 0 0 $avail_height_idx > $#{$$self{'rc2idx'};} ? :
833 0 0 if ($self->{'wantarray'} and defined $self->{'mark'})
836 0 0 if (defined $self->{'default'} and $self->{'default'} <= $#{$$self{"list"};})
839 0 0 if ($self->{'clear_screen'}) { }
845 0 0 if ($self->{'prompt_copy'} ne "")
849 0 0 if ($self->{'mouse'})
860 0 0 if (defined $self->{'footer_fmt'}) { }
0 0 elsif ($self->{'margin_bottom'}) { }
862 0 0 if ($self->{'margin_left'})
867 0 0 if ($self->{'margin_bottom'})
878 0 0 if ($self->{'margin_left'})
884 0 0 if ($#{$$self{"rc2idx"}[$row];})
890 0 0 if ($self->{'margin_left'})
903 0 0 $self->{'marked'}[$row][$col] ? :
0 0 $is_current_pos ? :
905 0 0 if ($self->{'ll'}) { }
906 0 0 if ($self->{'color'}) { }
908 0 0 if ($emphasised)
909 0 0 if ($is_current_pos and $self->{'color'} == 1) { }
922 0 0 if ($emphasised) { }
931 0 0 $self->{'current_layout'} == -1 ? :
932 0 0 if ($self->{'color'}) { }
934 0 0 if (not $self->{'orig_list'}[$idx]) { }
935 0 0 if (not defined $self->{'orig_list'}[$idx]) { }
0 0 elsif (not length $self->{'orig_list'}[$idx]) { }
945 0 0 if ($emphasised)
951 0 0 if ($is_current_pos and $self->{'color'} == 1)
957 0 0 if (@color)
959 0 0 unless ($emphasised)
966 0 0 if ($emphasised)
978 0 0 if ($self->{'current_layout'} == -1) { }
980 0 0 if ($col > 0)
999 0 0 if ($self->{'width_elements'}[$idx] < $self->{'col_width'}) { }
0 0 elsif ($self->{'width_elements'}[$idx] > $self->{'col_width'}) { }
1000 0 0 if ($self->{'alignment'} == 0) { }
0 0 elsif ($self->{'alignment'} == 1) { }
0 0 elsif ($self->{'alignment'} == 2) { }
1013 0 0 if ($self->{'col_width'} > 6) { }
1029 0 0 if ($newrow > $self->{'i_row'}) { }
0 0 elsif ($newrow < $self->{'i_row'}) { }
1037 0 0 if ($newcol > $self->{'i_col'}) { }
0 0 elsif ($newcol < $self->{'i_col'}) { }
1051 0 0 if ($self->{'margin_left'})
1054 0 0 if ($self->{'margin_right'})
1057 0 0 if ($self->{'margin_right'} or $self->{'col_width'} > $self->{'avail_width'} and $^O ne "MSWin32" and $^O ne "cygwin")
1063 0 0 if ($self->{'max_width'} and $self->{'avail_width'} > $self->{'max_width'})
1066 0 0 if ($self->{'avail_width'} < 1)
1073 0 0 if ($self->{'count_prompt_lines'})
1076 0 0 if ($self->{'page'})
1079 0 0 if ($self->{'margin_bottom'})
1082 0 0 if ($self->{'avail_height'} < $self->{'keep'})
1083 0 0 $self->{'term_height'} >= $self->{'keep'} ? :
1085 0 0 if ($self->{'max_height'} and $self->{'max_height'} < $self->{'avail_height'})
1094 0 0 if ($self->{'layout'} <= 1 and not $self->{'ll'} and not $self->{'max_cols'})
1098 0 0 if ($firstrow_width - $self->{'pad'} > $self->{'avail_width'})
1105 0 0 if ($all_in_first_row) { }
0 0 elsif ($self->{'col_width'} >= $self->{'avail_width'}) { }
1124 0 0 if ($layout == -1) { }
0 0 elsif ($layout == 2) { }
1137 0 0 if ($layout == 1)
1139 0 0 if @{$self->{'list'};} % $self->{'avail_height'}
1141 0 0 if ($tmc < $tmp_avail_width)
1148 0 0 if ($self->{'max_cols'} and $cols_per_row > $self->{'max_cols'})
1151 0 0 if $cols_per_row < 1
1153 0 0 if ($self->{'order'} == 1) { }
1159 0 0 if $c > $self->{'idx_of_last_col_in_last_row'}
1167 0 0 if $r == $rows - 1 and $c > $self->{'idx_of_last_col_in_last_row'}
1176 0 0 if $end > $#{$$self{"list"};}
1181 0 0 if $end > $#{$$self{"list"};}
1192 0 0 if ($self->{'current_layout'} == 2)
1194 0 0 if ($list_idx > $last_list_idx)
1203 0 0 if ($self->{'order'} == 0) { }
0 0 elsif ($self->{'order'} == 1) { }
1205 0 0 if ($list_idx > $last_list_idx)
1220 0 0 if ($list_idx > $last_list_idx)
1223 0 0 if ($list_idx < $last_list_idx_in_cols_full) { }
1241 0 0 if ($self->{'order'} == 1) { }
1244 0 0 if ($self->{'marked'}[$row][$col])
1253 0 0 if ($self->{'marked'}[$row][$col])