Condition Coverage

blib/lib/IO/Prompter.pm
Criterion Covered Total %
condition 110 304 36.1


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'}
254 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'}
260 10 5 82 defined $input and not $opt_ref->{'-line'}
265 94 1 2 exists $opt_ref->{'-fail'} and match($input, $opt_ref->{'-fail'})
282 12 0 84 defined $input and $opt_ref->{'-history'} ne "NONE"
289 90 6 0 $timedout and exists $opt_ref->{'-def'}
299 0 7 20 $succeeded &&= $input =~ /\A \s* y/imsx
300 7 20 0 $succeeded and $opt_ref->{'-yesno'}{'count'} > 1
317 84 2 4 &LIST() and not $succeeded
487 4 0 0 @_ && &looks_like_number($_[0])
501 4 0 0 @_ && &looks_like_number($_[0])
515 7 0 0 @_ && &looks_like_number($_[0])
529 5 0 0 @_ && &looks_like_number($_[0])
603 0 5 1 @_ and ref $_[0] || $_[0] =~ /$STD_CONSTRAINT/
611 0 2 0 @_ and ref $_[0] || $_[0] =~ /$STD_CONSTRAINT/
745 0 0 0 @_ && !($_[0] =~ /^-/)
769 0 0 0 $flag eq "-echo" and not eval { do { BEGIN {${^WARNING_BITS} = "\x44\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x15\x00\x04\x40\x45\x05"} require Term::ReadKey } }
772 0 0 0 @_ && !($_[0] =~ /^-/)
833 188 18 12 $redo and $arg =~ s/\A -.{$redo} (?=.)/-/msx
846 91 0 6 defined $option{'-single'} and length($option{'-echo'}->("X") // "echoself")
884 90 1 6 exists $option{'-def'} and not $option{'-def_nocheck'}
947 110 0 11 ${$input_ref;} =~ /^\R?$/msx and exists $opt_ref->{'-def'}
955 102 14 4 $opt_ref->{'-integer'} and not $input =~ /$INTEGER_PAT/
960 4 112 4 not $failed and $opt_ref->{'-number'}
112 2 2 not $failed and $opt_ref->{'-number'} and not $input =~ /$NUMBER_PAT/
983 6 52 62 not $failed and keys %constraint_for
1011 28 0 0 defined $fake_input and length $fake_input > 0
1030 96 1 0 exists $opt_ref->{'-timeout'} && $fileno >= 0
1033 97 0 0 $has_timeout and $fileno >= 0
1040 93 0 4 defined $fake_input and length $fake_input > 0
1087 10 81 6 defined $input && $opt_ref->{'-single'}
1226 97 0 0 -t $in_fh and $has_readkey
1271 0 0 0 defined $fake_input and length $fake_input > 0
1302 0 0 0 exists $opt_ref->{'-cancel'} and match($next, $opt_ref->{'-cancel'})
1322 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/
1345 0 0 0 $next =~ /$COMPLETE_INIT/ and index($completion_type, $next) < 0
1477 0 0 0 $faking and length $local_fake_input
1495 0 0 0 $input =~ /\A\R?\Z/msx and defined $opt_ref->{'-def'}
1519 0 0 0 $faking and $input =~ /^ (?: \cD | \cZ) /msx
1609 0 0 0 not defined $next and length $input == 0
0 0 0 exists $opt_ref->{'-cancel'} and match($next, $opt_ref->{'-cancel'})
1619 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
283 61 23 $history_cache{$opt_ref->{'-history'}} //= []
288 96 0 $in_pos == do { no warnings; tell $in_filehandle } // 0
756 0 0 ref $comp_spec || $comp_spec || '???'
846 6 0 $option{'-echo'}->("X") // "echoself"
847 6 0 $option{'-return'} //= sub { "\n"; }
922 0 0 shift @ARGV // "-"
965 120 0 $opt_ref->{'-must'} // {}
972 0 120 $extras // {}
973 26 94 $opt_ref->{'-yesno'}{'must'} // {}
977 0 120 $extras // {}
978 26 94 $opt_ref->{'-yesno'}{'must'} // {}
1029 97 0 fileno $in_fh // -1
1134 0 0 (ref $completer || $completer) // ""
1234 0 0 $ctrl{'EOF'} //= "\4"
1235 0 0 $ctrl{'INTERRUPT'} //= "\3"
1308 0 0 $next // ""
1442 0 0 $opt_ref->{'-echo'}->($_) // "X"
1660 0 1 $initial_prompt // ""
1689 10 0 shift @source // (last ITEM)
1758 0 0 shift() // ""
1776 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)
223 0 0 0 $opt_ref->{'-number'} || $opt_ref->{'-integer'}
235 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("-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; push @menu, _build_menu($input, "Select from $menu[-1]{'key_for'}{$tag}: ", $opt_ref->{'-number'} || $opt_ref->{'-integer'}); $menu[-1]{'prompt'} .= "> "; } ; } else { &$outputter_ref("-style", $opt_ref->{'-prompt'}); $input = &$inputter_ref(); } ; 1 } } // do { &$outputter_ref("-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; } ; } )))) }
313 5 0 1 $input // ()
386 0 1 0 ref $style or not $style =~ m[/]
397 0 0 0 ref $style or not $style =~ m[/]
414 0 0 0 &$arg($_) // $_
430 2 0 0 $STD_CONSTRAINT{$_} // _opt_err("invalid", -$option_type, "\"pos\", \"neg\", \"even\", etc.", qq["$_"])
603 2 1 3 ref $_[0] || $_[0] =~ /$STD_CONSTRAINT/
611 0 0 2 ref $_[0] || $_[0] =~ /$STD_CONSTRAINT/
821 0 0 0 not @_ or ref $_[0] ne "CODE"
842 1 0 0 $option{'-number'} || $option{'-integer'}
852 1 0 0 $option{'-prompt'} // $0
881 97 0 0 $option{'-history'} //= $option{'-prompt'}
1050 125 0 0 not $has_timeout or select $readbits, undef, undef, $timeout
1112 0 28 0 $term_width // $DEFAULT_TERM_WIDTH
1134 0 0 0 ref $completer || $completer
1236 0 0 0 $ctrl{'ERASE'} //= $^O eq "MSWin32" ? "\b" : "0177"
1240 0 0 0 $ctrl{'QUOTENEXT'} // $DEFAULT_VERBATIM_KEY
1259 0 0 0 not defined $prev_SIGINT or $prev_SIGINT eq "DEFAULT"
1322 0 0 0 $next =~ /$COMPLETE_INIT/ || $completion_level > 0 && $next =~ /$COMPLETE_CYCLE/
0 0 0 $prev_was_verbatim or not $next =~ /$ctrl/
1367 0 0 0 $COMPLETE_MODE{$completion_type}[$completion_level - 1] // $COMPLETE_MODE{$completion_type}[-1]
1568 0 0 0 $insert_offset or $prev_insert_offset
1596 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$]
1609 0 0 0 not defined $next and length $input == 0 or exists $opt_ref->{'-cancel'} and match($next, $opt_ref->{'-cancel'})
1638 0 0 0 not defined eval { do { $opt_ref->{'-monitor'}->($input_copy, \%opts) } } or $output_pos != &$outputter_ref(-(tell))
1780 0 0 0 $2 || exists $synonyms{$3}