Branch Coverage

blib/lib/Term/Shell/MultiCmd.pm
Criterion Covered Total %
branch 55 284 19.3


line true false branch
86 0 239 unless /(\w+)([\=\:](.*))?/
89 187 52 $2 ? :
93 0 34 if $_[0] and ref $_[0]
96 95 0 unless ref $k
97 0 95 unless exists $ret{$k}
101 0 239 unless defined $v
109 0 7 ref $p ? :
115 0 7 if (@p and not eval { do { &GetOptions(\%p, @p) } })
136 63 0 if defined $_
149 14 1 if (exists $c->{$w})
155 0 1 if (@c == 1)
160 0 1 if (@c > 1)
174 8 0 if $o->{'enable_sh_pipe'} and not $o->{'piper'}
186 0 0 $t eq 'f' ? :
0 0 $t eq 's' ? :
0 0 $t eq 'o' ? :
0 0 $t eq 'i' ? :
0 0 $t ? :
192 0 0 if $eq eq ":"
204 0 0 'HASH' eq ref $_[0] ? :
0 0 'ARRAY' eq ref $_[0] ? :
391 0 0 if (not $t) { }
0 0 elsif (defined $readline::rl_completion_function) { }
0 0 elsif (defined(my $attr = $t->Attribs)) { }
392 0 0 if -t select()
441 0 0 unless $root and $o->{'cmds'} != $root
446 0 0 if exists $$root{$_->[0]} and $$root{$_->[0]}[1] eq $_->[1]
454 0 8 if $root
463 8 0 if $o->{'help_cmd'}
468 8 0 if $o->{'quit_cmd'}
483 1 7 if $o->{'root_cmd'}
484 0 8 if $root
580 0 25 unless $p{'path'}
583 0 25 unless "CODE" eq ref $p{'exec'}
585 0 25 unless my $new = pop @w
588 0 8 if ("ARRAY" eq ref $r->{$w})
595 8 17 if ($p{'opts'})
596 0 8 ref $p{'opts'} ? :
600 0 16 if ref $op
603 0 0 ref $opts[0] ? :
0 16 $expecting ? :
630 1 0 if ('HASH' eq ref $cmd) { }
637 0 0 if @args
670 1 8 if (not ref $v) { }
8 0 elsif ('HASH' eq ref $v) { }
685 7 1 unless my $f = $o->{'history_file'}
686 1 0 unless -f $f
690 0 0 if $@
692 0 0 if "ARRAY" eq ref $hist and @$hist
693 0 0 unless ref $d and ref $more and ref $d eq ref $more
694 0 0 if "HASH" eq ref $d
695 0 0 if "ARRAY" eq ref $d
696 0 0 if "SCALAR" eq ref $d
702 8 0 unless my $f = $o->{'history_flash_file'}
703 0 0 unless -f $f
706 0 0 unless open F, "<", $f
708 0 0 if @A > $max
717 0 0 unless my $f = $o->{'history_file'}
719 0 0 unless ($o->{'history_flash_file'})
724 0 0 eval { do { store([[@his], $o->{'history_more'}], $f) } } ? :
745 0 0 if $o->{'history_data'}
770 0 0 unless ref $cmd
771 0 0 @args ? :
0 0 if "HASH" eq ref $cmd
774 0 0 if $comp and $comp == \&Term::Shell::MultiCmd::_root_command_comp
775 0 0 if $word =~ /^(\-\-?)(.*)/
776 0 0 if (@args and $args[-1] =~ /^\-\-?(.*)/)
778 0 0 if @op
779 0 0 unless $op
781 0 0 if "ARRAY" eq ref $cb or "HASH" eq ref $cb
782 0 0 if "CODE" eq ref $cb
784 0 0 if "ARRAY" eq ref $comp or "HASH" eq ref $comp
785 0 0 if "CODE" eq ref $comp
792 0 0 $last ? :
0 0 if $pre
793 0 0 if "ARRAY" eq ref $h
797 0 0 $last ? :
0 0 $pre ? :
0 0 unless $c eq $dlm
815 0 0 if ('ARRAY' eq ref $h) { }
0 0 elsif ('HASH' ne ref $h) { }
0 0 elsif ($p{'recursive'}) { }
0 0 elsif ($p{'tree'}) { }
0 0 elsif ($p{'full'}) { }
826 0 0 if exists $h->{$dlm}
829 0 0 if $k eq $dlm
839 0 0 if exists $h->{$dlm}
842 0 0 if $k eq $dlm
845 0 0 'ARRAY' eq ref $h->{$k} ? :
857 0 0 unless ref $cmd
858 0 0 if @args
868 0 0 unless ref $cmd
869 0 0 if "HASH" eq ref $cmd
879 0 0 unless $prolog
880 0 0 if $par and not $line
885 0 0 if $root
897 0 0 unless @argv
899 0 0 $o->{'root'} ? :
0 0 if $argv[0] =~ /^\-\-?d/
900 0 0 if $argv[0] =~ /^\-\-?c/
901 0 0 unless ($argv[0] =~ /^\-\-?s/)
905 0 0 if $root
910 0 0 if (@argv)
913 0 0 if $root
914 0 0 unless ref $cmd
915 0 0 if @args
916 0 0 if "ARRAY" eq ref $cmd
918 0 0 if ($o->{'root'})
922 0 0 if ($cmd)
931 0 8 if ($c =~ s/$r//)
941 8 0 unless my $p = $o->{'pager'}
943 0 0 if ($r and not ref $r)
947 0 0 if (not $r or $r and $c =~ s/$r//)
950 0 0 unless ref $o->{'pager'}
957 0 8 unless $cmd
965 0 0 @a ? :
0 0 if $c eq "cd" and $o->{'root_cmd'} and not exists $r->{'cd'}
970 0 8 if $o->{'help_cmd'} and $c eq 'ls' && !exists $r->{'ls'} || $c eq 'help' && !exists $r->{'help'}
986 1 6 if "CODE" eq ref $o->{'record_cmd'}
988 0 7 if ($o->{'history_flash_file'})
989 0 0 unless (_log_command($o->{'history_flash_file'}, $clt))
995 0 7 unless my($cmd, $path, @args) = &_travel($o, $clt)
999 0 7 if "p" eq ($o->{'piper'} || '')
1000 0 7 if "c" eq ($o->{'piper'} || '') and not $fh
1001 0 7 if ($fh)
1009 0 7 if ($fh)
1018 0 7 unless ref $cmd
1019 0 1 if $o->{'empty_cmd'} and $cmd eq ($o->{'root'} || $o->{'cmds'}) and 0 == length join("", @args)
1020 0 7 if $cmd eq $o->{'cmds'}
1021 0 0 if "HASH" eq ref $cmd and length $o->{'query_cmd'} and exists $$cmd{$o->{'query_cmd'}}
1022 0 7 unless "ARRAY" eq ref $cmd
1024 0 7 if $p{'_ERR_'}
1031 0 0 unless defined $file and defined $cmd
1033 0 0 if ($_log_command_last ne $cmd)
1035 0 0 unless open F, ">>", $file
1069 0 0 if defined $pos
1096 0 0 if "CODE" eq ref $p
1097 0 0 if $p =~ /\W$/
1098 0 0 if $o->{'root_path'}
1115 0 0 unless $o->{'term'}
1116 0 0 'ARRAY' eq ref $_ ? :
0 0 if @_