Branch Coverage

blib/lib/Term/ReadLine/Simple.pm
Criterion Covered Total %
branch 18 284 6.3


line true false branch
22 0 4 if ($^O eq 'MSWin32') { }
79 0 53 unless (defined $opt)
87 0 0 if (exists $opt->{'sep'} and not $self->{'called_sep_message'} and $sub ne 'readline')
99 1 79 unless (exists $valid->{$key})
102 11 68 unless (defined $opt->{$key})
105 15 53 if (ref $opt->{$key})
106 0 15 if ($valid->{$key} eq 'ARRAY')
111 24 29 if ($valid->{$key} eq '')
114 9 20 unless ($opt->{$key} =~ /^$valid->{$key}\z/x)
124 0 0 if ($self->{'reinit_encoding'})
132 0 3 if exists $self->{'enter_row'}
133 0 3 if exists $self->{'enter_col'}
134 3 0 if (defined $self->{'plugin'})
142 53 0 if (defined $opt)
143 0 53 if (ref $opt ne 'HASH')
171 0 0 if (defined $prompt) { }
172 0 0 if ref $prompt
177 0 0 if (defined $opt)
178 0 0 if (not ref $opt) { }
0 0 elsif (ref $opt ne 'HASH') { }
190 0 0 unless defined $opt->{'default'}
191 0 0 unless defined $opt->{'no_echo'}
204 0 0 if ($self->{'beep'})
213 0 0 unless (defined $key)
218 0 0 if $key == -1
219 0 0 if $key == 9
220 0 0 if ($key == 127 or $key == 8) { }
0 0 elsif ($key == 21) { }
0 0 elsif ($key == 11) { }
0 0 elsif ($key == 346 or $key == 4) { }
0 0 elsif ($key == 339 or $key == 6) { }
0 0 elsif ($key == 337 or $key == 2) { }
0 0 elsif ($key == 335 or $key == 5) { }
0 0 elsif ($key == 336 or $key == 1) { }
0 0 elsif ($key == 338 or $key == 340) { }
221 0 0 if ($pos) { }
230 0 0 if ($pos) { }
239 0 0 if ($pos < $str->length) { }
247 0 0 if ($str->length) { }
248 0 0 if ($pos < $str->length) { }
262 0 0 if ($pos < $str->length) { }
270 0 0 if ($pos) { }
278 0 0 if ($pos < $str->length) { }
286 0 0 if ($pos > 0) { }
299 0 0 if ($key eq "\n" or $key eq "\r") { }
302 0 0 if ($self->{'compat'} or not defined $self->{'compat'} and $ENV{'READLINE_SIMPLE_COMPAT'})
323 0 0 if ($print_str->substr(0, $print_pos)->columns > $self->{'avail_width_value'} / 4) { }
333 0 0 if ($b)
336 0 0 if ($e)
341 0 0 if ($opt->{'mark_curr'}) { }
350 0 0 if (&any(sub { $_ == $self->{'curr_row'} - @{$self->{'pre_list'};}; } , @{$$opt{'ro'};}))
353 0 0 if ($opt->{'no_echo'}) { }
354 0 0 if ($opt->{'no_echo'} == 2)
375 0 0 if ($i < @{$self->{'pre_list'};})
378 0 0 if $len->[$i] > $longest
389 0 0 if (defined $opt->{'main_prompt'})
394 0 0 if ($self->{'avail_height'} < $min_avail_height)
395 0 0 if ($backup_height > $min_avail_height) { }
403 0 0 if (@$list > $self->{'avail_height'}) { }
405 0 0 if (@$list % ($self->{'avail_height'} - 1))
420 0 0 if ($prompt eq '')
426 0 0 if (not $prompt =~ /\n/ and 'Unicode::GCString'->new($prompt)->columns <= $self->{'avail_width'}) { }
452 0 0 unless (defined $default)
463 0 0 if ($self->{'curr_row'} < @{$self->{'pre_list'};}) { }
477 0 0 if ($idx < @{$self->{'pre_list'};}) { }
481 0 0 defined $list->[$idx][1] ? :
485 0 0 if (&any(sub { $_ == $idx - @{$self->{'pre_list'};}; } , @{$$opt{'ro'};}))
498 0 0 if ($self->{'pages'} > 1) { }
499 0 0 if ($self->{'avail_height'} - ($self->{'end_row'} + 1 - $self->{'begin_row'}))
504 0 0 if (length $page_number > $self->{'avail_width'})
520 0 0 if ($self->{'len_longest_key'} > $self->{'avail_width'} / 3)
524 0 0 if (@{$opt->{'ro'};})
526 0 0 if $tmp > $len_separator
530 0 0 $opt->{'auto_up'} == 2 ? :
533 0 0 if ($self->{'end_row'} > $#$list)
536 0 0 if (defined $opt->{'main_prompt'})
545 0 0 if (not defined $orig_list) { }
0 0 elsif (ref $orig_list ne 'ARRAY') { }
551 0 0 if (defined $opt and ref $opt ne 'HASH')
567 0 0 unless defined $opt->{'prompt'}
568 0 0 unless defined $opt->{'back'}
569 0 0 unless defined $opt->{'confirm'}
570 0 0 unless defined $opt->{'auto_up'}
571 0 0 unless defined $opt->{'ro'}
576 0 0 if (length $opt->{'back'})
590 0 0 if (&any(sub { $_ == $self->{'curr_row'} - @{$self->{'pre_list'};}; } , @{$$opt{'ro'};}))
593 0 0 if ($self->{'beep'}) { }
601 0 0 unless (defined $key)
606 0 0 if $key == -1
607 0 0 if $key == 9
609 0 0 if ($tmp_maxcols != $maxcols or $tmp_maxrows != $maxrows and $tmp_maxrows < @$list + 1)
616 0 0 if ($key == 127 or $key == 8) { }
0 0 elsif ($key == 21) { }
0 0 elsif ($key == 11) { }
0 0 elsif ($key == 346 or $key == 4) { }
0 0 elsif ($key == 339) { }
0 0 elsif ($key == 337) { }
0 0 elsif ($key == 335 or $key == 5) { }
0 0 elsif ($key == 336 or $key == 1) { }
0 0 elsif ($key == 338) { }
0 0 elsif ($key == 340) { }
0 0 elsif ($key == 333 or $key == 2) { }
0 0 elsif ($key == 334 or $key == 6) { }
617 0 0 if ($locked) { }
0 0 elsif ($pos) { }
629 0 0 if ($locked) { }
0 0 elsif ($pos) { }
641 0 0 if ($locked) { }
0 0 elsif ($pos < $str->length) { }
652 0 0 if ($str->length) { }
653 0 0 if ($locked) { }
0 0 elsif ($pos < $str->length) { }
670 0 0 if ($pos < $str->length) { }
678 0 0 if ($pos) { }
686 0 0 if ($pos < $str->length) { }
694 0 0 if ($pos > 0) { }
702 0 0 if ($self->{'curr_row'} == 0) { }
708 0 0 if ($self->{'curr_row'} >= $self->{'begin_row'}) { }
718 0 0 if ($self->{'curr_row'} == $#$list) { }
724 0 0 if ($self->{'curr_row'} <= $self->{'end_row'}) { }
735 0 0 if ($self->{'page'} == 1) { }
736 0 0 if ($self->{'curr_row'} == 0) { }
754 0 0 if ($self->{'page'} == $self->{'pages'}) { }
755 0 0 if ($self->{'curr_row'} == $#$list) { }
775 0 0 if ($key eq "\n" or $key eq "\r") { }
777 0 0 if $self->{'nr_prompt_lines'}
778 0 0 if ($$list[$self->{'curr_row'}][0] eq $opt->{'back'}) { }
0 0 elsif ($$list[$self->{'curr_row'}][0] eq $opt->{'confirm'}) { }
789 0 0 if ($self->{'compat'} or not defined $self->{'compat'} and $ENV{'READLINE_SIMPLE_COMPAT'})
794 0 0 if ($opt->{'auto_up'} == 2) { }
0 0 elsif ($self->{'curr_row'} == $#$list) { }
795 0 0 if ($self->{'curr_row'} == 0) { }
814 0 0 if ($opt->{'auto_up'} == 1)
815 0 0 if (defined $self->{'enter_row'} and $self->{'enter_row'} == $self->{'curr_row'} and defined $self->{'enter_col'} and $self->{'enter_col'} == $pos) { }
828 0 0 if ($self->{'curr_row'} <= $self->{'end_row'}) { }
839 0 0 if ($locked) { }
863 0 0 if $self->{'end_row'} > $#$list
873 0 0 if $self->{'begin_row'} < 0
886 0 0 if ($key_length > $self->{'len_longest_key'}) { }
0 0 elsif ($key_length < $self->{'len_longest_key'}) { }
902 0 0 if ($gcs->columns <= $len)
910 0 0 if ($len - 3 < ($cols += $gc->columns))