Branch Coverage

blib/lib/Term/Form.pm
Criterion Covered Total %
branch 3 310 0.9


line true false branch
23 0 3 if ($^O eq 'MSWin32') { }
37 0 1 if @_ > 1
40 0 1 if (defined $opt)
41 0 0 if ref $opt ne "HASH"
45 0 0 if defined $opt->{$key}
105 0 0 if (defined $self->{'plugin'})
108 0 0 if ($up)
111 0 0 if ($self->{'clear_screen'} == 2) { }
117 0 0 if ($self->{'hide_cursor'} == 1) { }
0 0 elsif ($self->{'hide_cursor'} == 2) { }
129 0 0 if (exists $self->{'backup_instance_defaults'})
132 0 0 if ($key eq 'plugin' or $key eq 'backup_instance_defaults') { }
0 0 elsif (exists $instance_defaults->{$key}) { }
149 0 0 if ($self->{'color'}) { }
156 0 0 if push @color, $1
170 0 0 if ($self->{'i'}{'max_key_w'} > $term_w / 3)
189 0 0 if $self->{'i'}{'th'} > 40
195 0 0 if (defined $str) { }
215 0 0 if ($tmp_w > $self->{'i'}{'th'})
224 0 0 if ($tmp_w > $self->{'i'}{'th'})
235 0 0 unless (defined $default)
264 0 0 if ($m->{'pos'}) { }
270 0 0 unless ($m->{'diff'})
284 0 0 if ($m->{'pos'} < $#{$$m{'str'};}) { }
0 0 elsif ($m->{'pos'} == $#{$$m{'str'};}) { }
305 0 0 if ($m->{'pos'}) { }
312 0 0 unless ($m->{'diff'})
324 0 0 if ($m->{'pos'} < @{$m->{'str'};}) { }
325 0 0 unless ($m->{'diff'})
337 0 0 if ($m->{'pos'}) { }
352 0 0 if ($m->{'pos'} < @{$m->{'str'};}) { }
365 0 0 if ($m->{'pos'} > 0) { }
377 0 0 if ($m->{'pos'} < @{$m->{'str'};}) { }
395 0 0 if (not $m->{'diff'} and $m->{'p_pos'} < $self->{'i'}{'avail_w'} + $self->{'i'}{'arrow_w'})
399 0 0 if ($m->{'p_str_w'} <= $m->{'avail_w'})
430 0 0 if (defined $tmp->[1])
444 0 0 if ($m->{'p_str_w'} + $_->[1] > $m->{'avail_w'})
457 0 0 if ($m->{'p_str_w'} + $_->[1] > $m->{'avail_w'})
500 0 0 if ($self->{'no_echo'} and $self->{'no_echo'} == 2)
505 0 0 if ($m->{'diff'})
509 0 0 if ($self->{'no_echo'}) { }
516 0 0 if (@{$m->{'p_str'};} + $m->{'diff'} != @{$m->{'str'};})
523 0 0 if ($self->{'hide_cursor'})
527 0 0 if ($back_to_pos)
535 0 0 if print_columns($str) <= $len
544 0 0 if ($i < @{$self->{'i'}{'pre'};})
547 0 0 if (&any(sub { $_ == $i; } , @{$$self{"i"}{"keys_to_skip"};}))
551 0 0 if $len > $longest
560 0 0 if (length $self->{'i'}{'info_prompt'}) { }
562 0 0 if ($^O ne "MSWin32" and $^O ne "cygwin")
570 0 0 if ($term_h < $min_avail_h)
573 0 0 if ($self->{'i'}{'avail_h'} < $min_avail_h)
580 0 0 if (@$list > $self->{'i'}{'avail_h'}) { }
582 0 0 if (@$list % ($self->{'i'}{'avail_h'} - 1))
589 0 0 if ($self->{'page'} == 2 or $self->{'page'} == 1 and $self->{'i'}{'page_count'} > 1) { }
603 0 0 if ($self->{'i'}{'curr_row'} < @{$self->{'i'}{'pre'};}) { }
610 0 0 defined $_->[0] ? :
620 0 0 if (length $remainder)
622 0 0 if (length $remainder)
626 0 0 if (not length $self->{'i'}{'seps'}[$idx]) { }
0 0 elsif (length $self->{'i'}{'seps'}[$idx] == 1) { }
633 0 0 if (exists $self->{'i'}{'key_colors'} and @{$self->{'i'}{'key_colors'}[$idx];})
644 0 0 if ($idx < @{$self->{'i'}{'pre'};})
647 0 0 if (&any(sub { $_ == $idx; } , @{$$self{"i"}{"keys_to_skip"};}))
650 0 0 unless (defined $self->{'i'}{'keys'}[$idx])
654 0 0 unless (defined $self->{'i'}{'seps'}[$idx])
655 0 0 if (&any(sub { $_ == $idx; } , @{$$self{'i'}{'read_only'};})) { }
662 0 0 if (exists $self->{'i'}{'key_colors'} and @{$self->{'i'}{'key_colors'}[$idx];})
667 0 0 if (defined $list->[$idx][1]) { }
686 0 0 if ($self->{'i'}{'print_footer'})
688 0 0 if ($trailing_empty_page_rows > 1)
695 0 0 if ($up)
703 0 0 unless ($self->{'i'}{'print_footer'})
709 0 0 if ($self->{'footer'})
712 0 0 if (print_columns(sprintf($footer_fmt, $p_count)) > $term_w)
714 0 0 if (length sprintf($footer_fmt, $p_count) > $term_w)
715 0 0 if ($width_p_count > $term_w)
727 0 0 $self->{'auto_up'} ? :
730 0 0 if ($self->{'i'}{'end_row'} > $#$list)
735 0 0 if ($self->{'clear_screen'} == 1) { }
741 0 0 if ($self->{'hide_cursor'})
744 0 0 if (length $self->{'i'}{'info_prompt'})
758 0 0 if ($self->{'color'})
760 0 0 if push @color, $1
763 0 0 if (print_columns($tmp) > $term_w)
766 0 0 if (@color)
778 0 0 if ($self->{'clear_screen'} == 2)
781 0 0 if (length $self->{'footer'} and $self->{'page'} != 2)
784 0 0 if ($self->{'page'} == 2 and not $self->{'clear_screen'})
791 0 0 if (ref $_[0] ne "Term::Form")
797 0 0 unless defined $orig_list
798 0 0 if ref $orig_list ne "ARRAY"
799 0 0 unless defined $opt
800 0 0 if ref $opt ne "HASH"
801 0 0 unless @$orig_list
802 0 0 if (%$opt)
806 0 0 if defined $opt->{$key}
810 0 0 if ($^O eq "MSWin32")
811 0 0 $self->{'codepage_mapping'} ? :
814 0 0 if (length $self->{'info'})
817 0 0 if (length $self->{'prompt'})
823 0 0 if length $self->{'i'}{'sep'} != length $self->{'i'}{'sep_ro'}
839 0 0 if (@{$self->{'read_only'};})
844 0 0 if (defined $self->{'skip_items'}) { }
846 0 0 if (defined $orig_list->[$i][0] and $orig_list->[$i][0] =~ /$self->{'skip_items'}/) { }
871 0 0 if (&any(sub { $_ == $self->{'i'}{'curr_row'}; } , @{$$self{"i"}{"read_only"};}))
874 0 0 if ($self->{'i'}{'beep'}) { }
879 0 0 if ($self->{'hide_cursor'})
885 0 0 if (&any(sub { $_ == $self->{'i'}{'curr_row'}; } , @{$$self{'i'}{'keys_to_skip'};})) { }
886 0 0 if ($self->{'i'}{'direction'} eq 'up' or $self->{'i'}{'curr_row'} >= $self->{'i'}{'end_down'}) { }
897 0 0 unless (defined $char)
902 0 0 if $char == -1
903 0 0 if $char == 9
905 0 0 if ($tmp_term_w != $term_w or $tmp_term_h != $term_h and $tmp_term_h < @$list + 1)
907 0 0 if $up
922 0 0 if ($char == 127 or $char == 8) { }
0 0 elsif ($char == 21) { }
0 0 elsif ($char == 11) { }
0 0 elsif ($char == 346 or $char == 4) { }
0 0 elsif ($char == 339 or $char == 6) { }
0 0 elsif ($char == 337 or $char == 2) { }
0 0 elsif ($char == 335 or $char == 5) { }
0 0 elsif ($char == 336 or $char == 1) { }
0 0 elsif ($char == 338 or $char == 19) { }
0 0 elsif ($char == 340 or $char == 20) { }
0 0 elsif ($char == 333 or $char == 16) { }
0 0 elsif ($char == 334 or $char == 14) { }
0 0 elsif ($char == 24) { }
0 0 elsif ($char == 345) { }
0 0 elsif ($char == 10 or $char == 13) { }
924 0 0 if ($locked) { }
933 0 0 if ($locked) { }
942 0 0 if ($locked) { }
971 0 0 if ($self->{'i'}{'curr_row'} == 0) { }
977 0 0 if ($self->{'i'}{'curr_row'} >= $self->{'i'}{'begin_row'}) { }
988 0 0 if ($self->{'i'}{'curr_row'} == $#$list) { }
994 0 0 if ($self->{'i'}{'curr_row'} <= $self->{'i'}{'end_row'}) { }
1006 0 0 if ($self->{'i'}{'curr_page'} == 1) { }
1007 0 0 if ($self->{'i'}{'curr_row'} == 0) { }
1019 0 0 if $up
1027 0 0 if ($self->{'i'}{'curr_page'} == $self->{'i'}{'page_count'}) { }
1028 0 0 if ($self->{'i'}{'curr_row'} == $#$list) { }
1041 0 0 if $up
1048 0 0 if (@{$m->{'str'};}) { }
1062 0 0 if ($self->{'i'}{'info_prompt_row_count'})
1065 0 0 if ($$list[$self->{'i'}{'curr_row'}][0] eq $self->{'back'}) { }
0 0 elsif ($$list[$self->{'i'}{'curr_row'}][0] eq $self->{'confirm'}) { }
1074 0 0 if ($self->{'auto_up'} == 2 or $self->{'i'}{'curr_row'} == $#$list) { }
1083 0 0 if ($self->{'i'}{'curr_row'} <= $self->{'i'}{'end_row'}) { }
1095 0 0 if ($locked) { }
1112 0 0 if ($self->{'i'}{'curr_row'} < $idx)
1122 0 0 if $self->{'i'}{'end_row'} > $#$list
1125 0 0 if ($self->{'i'}{'curr_row'} == $self->{'i'}{'end_row'})
1135 0 0 if $self->{'i'}{'begin_row'} < 0
1138 0 0 if ($self->{'i'}{'curr_row'} > $self->{'i'}{'begin_row'})