Branch Coverage

blib/lib/Term/Shell.pm
Criterion Covered Total %
branch 56 208 26.9


line true false branch
44 0 3 $^O eq 'MSWin32' ? :
55 0 3 if ($o->{'API'}{'readline'} eq 'Term::ReadLine::Gnu') { }
0 3 elsif ($o->{'API'}{'readline'} eq 'Term::ReadLine::Perl') { }
80 0 0 if ($o->line =~ /\S/u) { }
84 0 0 unless ($o->{'command'}{'run'}{'found'})
87 0 0 if (@c and $o->{'API'}{'match_uniq'}) { }
113 0 0 if $o->{'stop'}
125 0 0 if $o->{'API'}{'check_idle'} == 0 or not defined $o->{'term'}->IN
142 0 0 if ('IO::Select'->new($o->{'fh'})->can_read($timeout)) { }
183 1 0 if ($lines < $maxlines or $maxlines == 0 or $pager eq 'none') { }
0 0 elsif ($pager and $pager ne 'internal') { }
196 0 0 unless system($pager, $name) == 0
213 0 0 if $ret == -1
234 0 0 if $line >= $maxlines - 1
242 0 0 if ($o->have_readkey) { }
251 0 0 if ($lines_left > 0)
258 0 0 if $o->have_readkey
259 0 0 if $ans =~ /q/iu or not $o->have_readkey
260 0 0 if $ans =~ /q/iu
282 0 0 unless $o->{'command'}{'comp'}{'found'}
308 64 434 if (my($ret) = (shift()) =~ /\A(run|help|smry|comp|catch|alias)_/u)
318 217 32 unless defined $t
322 26 6 if (length $s)
333 217 32 unless defined $t
337 26 6 if (length $s)
342 0 32 if ($o->has_aliases($s))
370 0 0 unless $hnd =~ /^(run|help|smry|comp|catch|alias)_/ou
375 0 0 if (length $a)
410 0 3 unless $TERM
414 0 3 if ($TERM and $o->{'API'}{'readline'} eq 'Term::ReadLine::Gnu')
420 0 3 if ($^O eq 'MSWin32' and eval { do { require Win32::Console } })
432 0 3 if (eval { do { require Term::Size } })
435 0 0 if (@x == 2 and $x[0])
442 0 3 if (eval { do { require Term::Screen } })
449 3 0 if (eval { do { require Term::ReadKey } })
455 3 0 unless $@
458 0 0 if ($ENV{'LINES'} or $ENV{'ROWS'} or $ENV{'COLUMNS'})
467 0 0 if (open my $STTY, '-|', 'stty', 'size')
482 0 0 unless $o->{'readkey'}
489 0 0 if $o->{'have_readkey'}
491 0 0 if (eval { do { require Term::InKey } }) { }
0 0 elsif ($^O eq 'MSWin32' and eval { do { require Win32::Console } }) { }
0 0 elsif (eval { do { require Term::ReadKey } }) { }
505 0 0 unless my $mode = my $orig = $o->{'win32_stdin'}->Mode
507 0 0 unless $o->{'win32_stdin'}->Mode($mode)
509 0 0 unless $o->{'win32_stdin'}->Flush
511 0 0 unless defined $c
512 0 0 unless $o->{'win32_stdin'}->Mode($orig)
514 0 0 if $@
546 0 0 $gh ? :
547 0 0 if $sh
549 0 0 if !defined($line) || $line =~ /^\s*$/u and defined $default
554 0 0 if $sh
564 0 0 if ($term and $term->ReadLine eq 'Term::ReadLine::Gnu') { }
0 0 elsif ($term and $term->ReadLine eq 'Term::ReadLine::Perl') { }
592 0 2 if ($wrap)
598 0 0 if ($@)
600 0 0 if $^W
612 0 3 unless defined $vals[$i]
614 3 0 $left ? :
615 3 0 $left ? :
618 0 3 $wrap ? :
630 0 2 wantarray ? :
648 0 0 if $c eq '\\'
649 0 0 if $c eq $q
665 0 0 if ($c eq '\\') { }
690 0 0 unless $o->{'line_args'}
705 0 0 if ($c =~ /\S/u and @args == 1)
709 0 0 if ($c =~ /['"]/u) { }
0 0 elsif ($c =~ /\s/u) { }
713 0 0 defined $arg ? :
724 0 0 if defined $arg
732 0 0 if defined $arg
754 3 0 if $o->{'API'}{'match_uniq'}
762 4 2 unless @handlers == 1
763 0 2 if $add_cmd_name and not $preserve_args
777 0 0 unless defined $casei
778 0 0 $casei ? :
813 2 1 defined $handler ? :
821 2 1 if (defined $handler)
842 0 0 if $seen{$_}-- == 1
851 0 8 $o->{'API'}{'case_ignore'} ? :
863 0 4 $o->{'API'}{'case_ignore'} ? :
867 2 2 unless @key == 1
875 0 0 exists $o->{'handlers'}{$action}{'alias'} ? :
883 0 32 @a ? :
892 32 0 unless $hndlr
904 0 2 unless $type
906 2 0 unless exists $o->{'aliases'}{$cmd}
949 0 0 if ($start == 0 or substr($line, 0, $start) =~ /^\s*$/u) { }
952 0 0 if $o->{'command'}{'comp'}{'found'}
961 0 0 if $o->{'command'}{'comp'}{'found'}
998 0 0 if @words > 2 or @words == 2 and $start == length $line
1007 0 1 if ($cmd) { }
1010 0 0 if ($o->{'command'}{'help'}{'found'}) { }
1017 0 0 if (@c and $o->{'API'}{'match_uniq'}) { }
1041 1 3 unless length $h
1043 0 3 unless grep {defined $o->{'handlers'}{$h}{$_};} 'run', 'smry', 'help'
1045 3 0 exists $o->{'handlers'}{$h}{'run'} ? :
1046 2 1 $x ? :
1051 2 0 exists $o->{'handlers'}{$h}{'smry'} ? :
2 1 exists $o->{'handlers'}{$h}{'help'} ? :
1058 1 0 if %cmds
1065 0 1 if %docs