Branch Coverage

blib/lib/Term/ReadLine/Simple.pm
Criterion Covered Total %
branch 18 276 6.5


line true false branch
21 0 4 if ($^O eq 'MSWin32') { }
78 0 53 unless (defined $opt)
86 0 0 if (exists $opt->{'sep'} and not $self->{'called_sep_message'} and $sub ne 'readline')
98 1 72 unless (exists $valid->{$key})
101 11 61 unless (defined $opt->{$key})
104 15 46 if (ref $opt->{$key})
105 0 15 if ($valid->{$key} eq 'ARRAY')
110 23 23 if ($valid->{$key} eq '')
113 9 14 unless ($opt->{$key} =~ /^$valid->{$key}\z/x)
123 0 0 if ($self->{'reinit_encoding'})
131 0 3 if exists $self->{'enter_row'}
132 0 3 if exists $self->{'enter_col'}
133 3 0 if (defined $self->{'plugin'})
141 53 0 if (defined $opt)
142 0 53 if (ref $opt ne 'HASH')
170 0 0 if (defined $prompt) { }
171 0 0 if ref $prompt
176 0 0 if (defined $opt)
177 0 0 if (not ref $opt) { }
0 0 elsif (ref $opt ne 'HASH') { }
189 0 0 unless defined $opt->{'default'}
190 0 0 unless defined $opt->{'no_echo'}
203 0 0 if ($self->{'beep'})
212 0 0 unless (defined $key)
217 0 0 if $key == -1
218 0 0 if $key == 9
219 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) { }
220 0 0 if ($pos) { }
229 0 0 if ($pos) { }
238 0 0 if ($pos < $str->length) { }
246 0 0 if ($str->length) { }
247 0 0 if ($pos < $str->length) { }
261 0 0 if ($pos < $str->length) { }
269 0 0 if ($pos) { }
277 0 0 if ($pos < $str->length) { }
285 0 0 if ($pos > 0) { }
298 0 0 if ($key eq "\n" or $key eq "\r") { }
301 0 0 if ($self->{'compat'} or not defined $self->{'compat'} and $ENV{'READLINE_SIMPLE_COMPAT'})
322 0 0 if ($print_str->substr(0, $print_pos)->columns > $self->{'avail_width_value'} / 4) { }
332 0 0 if ($b)
335 0 0 if ($e)
340 0 0 if ($opt->{'mark_curr'}) { }
349 0 0 if (&any(sub { $_ == $self->{'curr_row'} - @{$self->{'pre_list'};}; } , @{$$opt{'ro'};}))
352 0 0 if ($opt->{'no_echo'}) { }
353 0 0 if ($opt->{'no_echo'} == 2)
374 0 0 if ($i < @{$self->{'pre_list'};})
377 0 0 if $len->[$i] > $longest
388 0 0 if (defined $opt->{'main_prompt'})
391 0 0 if (@$list > $self->{'avail_height'}) { }
393 0 0 if (@$list % ($self->{'avail_height'} - 1))
408 0 0 unless (defined $default)
419 0 0 if ($self->{'curr_row'} < @{$self->{'pre_list'};}) { }
433 0 0 if ($idx < @{$self->{'pre_list'};}) { }
437 0 0 defined $list->[$idx][1] ? :
441 0 0 if (&any(sub { $_ == $idx - @{$self->{'pre_list'};}; } , @{$$opt{'ro'};}))
454 0 0 if ($self->{'pages'} > 1) { }
455 0 0 if ($self->{'avail_height'} - ($self->{'end_row'} + 1 - $self->{'begin_row'}))
460 0 0 if (length $page_number > $self->{'avail_width'})
476 0 0 if ($self->{'len_longest_key'} > $self->{'avail_width'} / 3)
480 0 0 if (@{$opt->{'ro'};})
482 0 0 if $tmp > $len_separator
486 0 0 $opt->{'auto_up'} == 2 ? :
489 0 0 if ($self->{'end_row'} > $#$list)
492 0 0 if (defined $opt->{'main_prompt'})
501 0 0 if (not defined $orig_list) { }
0 0 elsif (ref $orig_list ne 'ARRAY') { }
507 0 0 if (defined $opt and ref $opt ne 'HASH')
523 0 0 unless defined $opt->{'prompt'}
524 0 0 unless defined $opt->{'back'}
525 0 0 unless defined $opt->{'confirm'}
526 0 0 unless defined $opt->{'auto_up'}
527 0 0 unless defined $opt->{'ro'}
532 0 0 if (length $opt->{'back'})
546 0 0 if (&any(sub { $_ == $self->{'curr_row'} - @{$self->{'pre_list'};}; } , @{$$opt{'ro'};}))
549 0 0 if ($self->{'beep'}) { }
557 0 0 unless (defined $key)
562 0 0 if $key == -1
563 0 0 if $key == 9
565 0 0 if ($tmp_maxcols != $maxcols or $tmp_maxrows != $maxrows and $tmp_maxrows < @$list + 1)
572 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) { }
573 0 0 if ($locked) { }
0 0 elsif ($pos) { }
585 0 0 if ($locked) { }
0 0 elsif ($pos) { }
597 0 0 if ($locked) { }
0 0 elsif ($pos < $str->length) { }
608 0 0 if ($str->length) { }
609 0 0 if ($locked) { }
0 0 elsif ($pos < $str->length) { }
626 0 0 if ($pos < $str->length) { }
634 0 0 if ($pos) { }
642 0 0 if ($pos < $str->length) { }
650 0 0 if ($pos > 0) { }
658 0 0 if ($self->{'curr_row'} == 0) { }
664 0 0 if ($self->{'curr_row'} >= $self->{'begin_row'}) { }
674 0 0 if ($self->{'curr_row'} == $#$list) { }
680 0 0 if ($self->{'curr_row'} <= $self->{'end_row'}) { }
691 0 0 if ($self->{'page'} == 1) { }
692 0 0 if ($self->{'curr_row'} == 0) { }
710 0 0 if ($self->{'page'} == $self->{'pages'}) { }
711 0 0 if ($self->{'curr_row'} == $#$list) { }
731 0 0 if ($key eq "\n" or $key eq "\r") { }
733 0 0 if $opt->{'main_prompt'}
734 0 0 if ($$list[$self->{'curr_row'}][0] eq $opt->{'back'}) { }
0 0 elsif ($$list[$self->{'curr_row'}][0] eq $opt->{'confirm'}) { }
745 0 0 if ($self->{'compat'} or not defined $self->{'compat'} and $ENV{'READLINE_SIMPLE_COMPAT'})
750 0 0 if ($opt->{'auto_up'} == 2) { }
0 0 elsif ($self->{'curr_row'} == $#$list) { }
751 0 0 if ($self->{'curr_row'} == 0) { }
770 0 0 if ($opt->{'auto_up'} == 1)
771 0 0 if (defined $self->{'enter_row'} and $self->{'enter_row'} == $self->{'curr_row'} and defined $self->{'enter_col'} and $self->{'enter_col'} == $pos) { }
784 0 0 if ($self->{'curr_row'} <= $self->{'end_row'}) { }
795 0 0 if ($locked) { }
819 0 0 if $self->{'end_row'} > $#$list
829 0 0 if $self->{'begin_row'} < 0
842 0 0 if ($key_length > $self->{'len_longest_key'}) { }
0 0 elsif ($key_length < $self->{'len_longest_key'}) { }
858 0 0 if ($gcs->columns <= $len)
866 0 0 if ($len - 3 < ($cols += $gc->columns))