Condition Coverage

blib/lib/IO/Prompter.pm
Criterion Covered Total %
condition 110 310 35.4


and 3 conditions

line !l l&&!r l&&r condition
88 35 7 0 defined $config_data and $config_data eq "-argv"
136 94 1 2 &VOID() and not $opt_ref->{'-void'}
160 0 0 97 &openhandle($in_filehandle) and &openhandle($out_filehandle)
163 97 0 0 -t $in_filehandle && -t $out_filehandle
209 0 0 1 $tag =~ /\A\R?\Z/ and exists $opt_ref->{'-def'}
256 10 82 5 defined $input and $input =~ /\A\R?\Z/
92 0 5 defined $input and $input =~ /\A\R?\Z/ and exists $opt_ref->{'-def'}
262 10 5 82 defined $input and not $opt_ref->{'-line'}
268 94 1 2 exists $opt_ref->{'-fail'} and match($input, $opt_ref->{'-fail'})
285 12 0 84 defined $input and $opt_ref->{'-history'} ne "NONE"
293 90 6 0 $timedout and exists $opt_ref->{'-def'}
303 0 7 20 $succeeded &&= $input =~ /\A \s* y/imsx
304 7 20 0 $succeeded and $opt_ref->{'-yesno'}{'count'} > 1
321 84 2 4 &LIST() and not $succeeded
492 4 0 0 @_ && &looks_like_number($_[0])
506 4 0 0 @_ && &looks_like_number($_[0])
520 7 0 0 @_ && &looks_like_number($_[0])
534 5 0 0 @_ && &looks_like_number($_[0])
615 0 5 1 @_ and ref $_[0] || $_[0] =~ /$STD_CONSTRAINT/
623 0 2 0 @_ and ref $_[0] || $_[0] =~ /$STD_CONSTRAINT/
757 0 0 0 @_ && !($_[0] =~ /^-/)
781 0 0 0 $flag eq "-echo" and not eval { do { BEGIN {${^WARNING_BITS} = "\x45\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x50\x41\x50\x41\x00\x00\x01\x00\x55\x55"} require Term::ReadKey } }
784 0 0 0 @_ && !($_[0] =~ /^-/)
845 188 18 12 $redo and $arg =~ s/\A -.{$redo} (?=.)/-/msx
858 91 0 6 defined $option{'-single'} and length($option{'-echo'}->("X") // "echoself")
896 90 1 6 exists $option{'-def'} and not $option{'-def_nocheck'}
959 110 0 11 ${$input_ref;} =~ /^\R?$/msx and exists $opt_ref->{'-def'}
967 102 14 4 $opt_ref->{'-integer'} and not $input =~ /$INTEGER_PAT/
972 4 112 4 not $failed and $opt_ref->{'-number'}
112 2 2 not $failed and $opt_ref->{'-number'} and not $input =~ /$NUMBER_PAT/
995 6 52 62 not $failed and keys %constraint_for
1023 28 0 0 defined $fake_input and length $fake_input > 0
1042 96 1 0 exists $opt_ref->{'-timeout'} && $fileno >= 0
1045 97 0 0 $has_timeout and $fileno >= 0
1052 93 0 4 defined $fake_input and length $fake_input > 0
1099 10 81 6 defined $input && $opt_ref->{'-single'}
1238 97 0 0 -t $in_fh and $has_readkey
1269 0 0 0 defined $prev_SIGINT and $prev_SIGINT eq "IGNORE"
1283 0 0 0 defined $fake_input and length $fake_input > 0
1314 0 0 0 exists $opt_ref->{'-cancel'} and match($next, $opt_ref->{'-cancel'})
1334 0 0 0 not $prev_was_verbatim and $next eq $VERBATIM_KEY
0 0 0 not $prev_was_verbatim and $next =~ /$COMPLETE_INIT/ || $completion_level > 0 && $next =~ /$COMPLETE_CYCLE/
0 0 0 not $prev_was_verbatim and $next eq $ctrl{'ERASE'}
0 0 0 not $prev_was_verbatim and $next eq $ctrl{'EOF'}
0 0 0 not $prev_was_verbatim and $faking
0 0 0 not $prev_was_verbatim and $faking and $next eq $FAKE_ESC
0 0 0 not $prev_was_verbatim and $next =~ /\A\R\z/
1357 0 0 0 $next =~ /$COMPLETE_INIT/ and index($completion_type, $next) == -1
1489 0 0 0 $faking and length $local_fake_input
1507 0 0 0 $input =~ /\A\R?\Z/msx and defined $opt_ref->{'-def'}
1531 0 0 0 $faking and $input =~ /^ (?: \cD | \cZ) /msx
1621 0 0 0 not defined $next and length $input == 0
0 0 0 exists $opt_ref->{'-cancel'} and match($next, $opt_ref->{'-cancel'})
1631 0 0 0 $opt_ref->{'-single'} and exists $opt_ref->{'-return'}
0 0 0 $opt_ref->{'-single'} and exists $opt_ref->{'-return'} and not $input =~ /\A\R\z/

or 2 conditions

line l !l condition
109 3 0 $lexical_wrappers[$scope_number]{$subname} // []
129 4 95 (&CORE::GLOBAL::caller(0))[10] // {}
130 4 95 $hints_hash->{'IO::Prompter::scope_number'} // 0
140 27 70 $opt_ref->{'-yesno'}{'count'} // 0
157 97 0 do { no warnings; tell $in_filehandle } // 0
287 61 23 $history_cache{$opt_ref->{'-history'}} //= []
292 96 0 $in_pos == do { no warnings; tell $in_filehandle } // 0
598 0 0 shift @_ // ""
768 0 0 ref $comp_spec || $comp_spec || '???'
858 6 0 $option{'-echo'}->("X") // "echoself"
934 0 0 shift @ARGV // "-"
977 120 0 $opt_ref->{'-must'} // {}
984 0 120 $extras // {}
985 26 94 $opt_ref->{'-yesno'}{'must'} // {}
989 0 120 $extras // {}
990 26 94 $opt_ref->{'-yesno'}{'must'} // {}
1041 97 0 fileno $in_fh // -1
1146 0 0 (ref $completer || $completer) // ""
1246 0 0 $ctrl{'EOF'} //= "\4"
1247 0 0 $ctrl{'INTERRUPT'} //= "\3"
1320 0 0 $next // ""
1454 0 0 $opt_ref->{'-echo'}->($_) // "X"
1672 0 1 $initial_prompt // ""
1698 10 0 shift @source // (last ITEM)
1765 0 0 shift() // ""
1783 0 0 $1 // ""

or 3 conditions

line l !l&&r !l&&!r condition
143 17 80 0 $opt_ref->{'-in'} // _open_ARGV()
144 6 91 0 $opt_ref->{'-out'} // &qualify_to_ref(select)
224 0 0 0 $opt_ref->{'-number'} || $opt_ref->{'-integer'}
236 97 0 0 eval { do { REPROMPT_YESNO: if ($opt_ref->{'-menu'}) { my(@menu) = $opt_ref->{'-menu'}; my $top_prompt = $opt_ref->{'-prompt'}; $top_prompt =~ s/$MENU_MK/$opt_ref->{'-menu'}{'prompt'}/msx; $menu[-1]{'prompt'} = $top_prompt; MENU: while (1) { $opt_ref->{'-menu_curr_level'} = $menu[-1]{'value_for'}; &$outputter_ref("-indent", "-style", $menu[-1]{'prompt'}); my $tag = &$inputter_ref($menu[-1]{'constraint'}); last MENU unless defined $tag; $tag =~ s/\A\s*(\S*).*/$1/msx; if ($tag eq $MENU_ESC) { $input = undef; last MENU if @menu <= 1; pop @menu; next MENU; } ; if ($tag =~ /\A\R?\Z/ and exists $opt_ref->{'-def'}) { $input = $tag; last MENU; } ; $input = $menu[-1]{'value_for'}{$tag}; last MENU unless ref $input; (my $submenu_name = $menu[-1]{'key_for'}{$tag}) =~ s/\A(?:[\cA-\cZ]|\\c[a-zA-Z])\h*//; push @menu, _build_menu($input, "Select from ${submenu_name}: ", $opt_ref->{'-number'} || $opt_ref->{'-integer'}); $menu[-1]{'prompt'} .= '> '; } ; } else { &$outputter_ref("-indent", "-style", $opt_ref->{'-prompt'}); $input = &$inputter_ref(); } ; 1 } } // do { &$outputter_ref("-noindent", "-echostyle", $opt_ref->{'-return'}->("")) if exists $opt_ref->{'-return'}; my $error = $@; die $@ unless ref $error eq "IO::Prompter::Cancellation"; return if $opt_ref->{'-verbatim'}; return &PUREBOOL(sub { 0; } , scalar &BOOL(sub { 0; } , scalar &SCALAR(sub { ${$error;}; } , scalar &METHOD(sub { "defaulted", sub { 0; } , "timedout", sub { 0; } ; } )))) }
317 5 0 1 $input // ()
390 0 1 0 ref $style or not $style =~ m[/]
401 0 0 0 ref $style or not $style =~ m[/]
418 0 0 0 &$arg($_) // $_
434 2 0 0 $STD_CONSTRAINT{$_} // _opt_err("invalid", -$option_type, "\"pos\", \"neg\", \"even\", etc.", qq["$_"])
615 2 1 3 ref $_[0] || $_[0] =~ /$STD_CONSTRAINT/
623 0 0 2 ref $_[0] || $_[0] =~ /$STD_CONSTRAINT/
833 0 0 0 not @_ or ref $_[0] ne "CODE"
854 1 0 0 $option{'-number'} || $option{'-integer'}
859 6 0 0 $option{'-return'} //= sub { "\n"; }
864 1 0 0 $option{'-prompt'} // $0
893 97 0 0 $option{'-history'} //= $option{'-prompt'}
1062 125 0 0 not $has_timeout or select $readbits, undef, undef, $timeout
1124 0 28 0 $term_width // $DEFAULT_TERM_WIDTH
1146 0 0 0 ref $completer || $completer
1248 0 0 0 $ctrl{'ERASE'} //= $^O eq "MSWin32" ? "\b" : "0177"
1252 0 0 0 $ctrl{'QUOTENEXT'} // $DEFAULT_VERBATIM_KEY
1271 0 0 0 not defined $prev_SIGINT or $prev_SIGINT eq "DEFAULT"
1334 0 0 0 $next =~ /$COMPLETE_INIT/ || $completion_level > 0 && $next =~ /$COMPLETE_CYCLE/
0 0 0 $prev_was_verbatim or not $next =~ /$ctrl/
1379 0 0 0 $COMPLETE_MODE{$completion_type}[$completion_level - 1] // $COMPLETE_MODE{$completion_type}[-1]
1580 0 0 0 $insert_offset or $prev_insert_offset
1608 0 0 0 $opt_ref->{'-single'} or not defined $next
0 0 0 $opt_ref->{'-single'} or not defined $next or $input =~ m[\Q$/\E$]
1621 0 0 0 not defined $next and length $input == 0 or exists $opt_ref->{'-cancel'} and match($next, $opt_ref->{'-cancel'})
1650 0 0 0 not defined eval { do { $opt_ref->{'-monitor'}->($input_copy, \%opts) } } or $output_pos != &$outputter_ref(-(tell))
1787 0 0 0 $2 || exists $synonyms{$3}