Branch Coverage

blib/lib/Zoidberg.pm
Criterion Covered Total %
branch 172 432 39.8


line true false branch
196 16 0 @_ ? :
206 16 0 unless ref $CURRENT eq $class
211 0 16 unless $$self{'_settings'}{'data_dirs'}
237 295 0 if $pwd eq $ENV{'PWD'}
240 0 0 if $$self{'settings'}{'interactive'}
265 0 32 if ($c =~ /::/) { }
272 0 0 if $type eq '->'
279 0 0 if @$block > 2
283 0 0 if exists $$self{'aliases'}{'mode_' . $c}
290 0 32 if $] < 5.008
291 0 32 exists $$self{'parser'}{$c} ? :
299 0 16 unless (@rcfiles)
303 0 0 if (copy($rc_template, $new_rc)) { }
319 0 19 if @_ > 1
346 0 0 if ($@) { }
354 0 0 if (not defined $cmd || $$self{'_settings'}{'ignoreeof'}) { }
360 0 0 unless $$self{'_continue'}
362 0 0 if length $cmd
373 0 110 unless ref $meta eq 'HASH'
376 110 0 $$self{'_settings'}{'split_script'} ? :
379 0 110 @list && !ref($list[-1]) && !($list[-1] =~ /^EO/) ? :
0 110 $$self{'stringparser'}{'broken'} ? :
381 0 110 if ($b and not $$self{'_settings'}{'interactive'}) { }
0 110 elsif ($b) { }
382 0 0 if $b == 2
389 0 0 if ($@)
396 0 110 if ($$meta{'interactive'})
399 0 0 if $$self{'_settings'}{'verbose'}
410 141 84 if ($t eq 'SCALAR') { }
84 0 elsif ($t eq 'ARRAY') { }
412 26 58 if (ref $$block[0] eq 'HASH') { }
416 0 0 $t ? :
425 0 200 ref $_[0] eq 'HASH' ? :
436 134 200 if (not $t or $t eq 'SCALAR') { }
200 0 elsif ($t eq 'ARRAY') { }
0 0 elsif ($t eq 'CODE') { }
437 0 134 $t ? :
438 0 134 if @words and $words[0] =~ s/^\!\s*//
441 200 0 if ref $$block[0] eq 'HASH'
442 134 66 unless (@$block > 1 or $$meta{'plain_words'})
448 0 66 if @words and $words[0] eq '!'
455 195 0 if (@words and not $$meta{'pretend'} and $$meta{'parse_aliases'})
457 0 195 if (@blocks > 1) { }
0 195 elsif (not @blocks) { }
466 0 200 if $words[0] eq 'mode'
471 0 0 if $r
473 5 195 unless $$meta{'context'} or @words
475 0 195 if $$meta{'zoidcmd'} =~ /^\s*\(.*\)\s*$/s
478 195 0 unless ($$meta{'context'} or not $$meta{'parse_def_contexts'})
481 36 159 if ($$meta{'zoidcmd'} =~ s/^\s*(\w*){(.*)}(\w*)\s*$/$2/s or $$meta{'pretend'} and $$meta{'zoidcmd'} =~ s/^\s*(\w*){(.*)$/$2/s) { }
0 159 elsif ($$meta{'zoidcmd'} =~ s/^\s*(\w+):\s+//) { }
0 159 elsif (@words == 1 and $words[0] =~ /^%/) { }
10 149 elsif ($words[0] =~ /^\s*(->|[\$\@\%\&\*\xA3]\S|\w+::|\w+[\(\{]|($perl_regexp)\b)/s) { }
485 36 0 if (not length $1) { }
0 0 elsif (grep {$_ eq $1;} 's', 'm', 'tr', 'y') { }
488 0 0 $1 eq 'm' ? :
506 0 195 if ($$self{'_settings'}{'mode'} and not $$meta{'no_mode'})
508 0 0 $m =~ /::/ ? :
511 0 195 if $$meta{'pretend'} and @words == 1
514 149 46 unless ($$meta{'context'})
518 0 0 if (not $r) { }
0 0 elsif (ref $r) { }
520 0 0 length $r > 1 ? :
521 0 0 if $$meta{'context'}
526 149 46 unless ($$meta{'context'} or not $$meta{'parse_def_contexts'})
531 0 195 if (exists $$self{'parser'}{$$meta{'context'}} and exists $$self{'parser'}{$$meta{'context'}}{'parser'}) { }
46 149 elsif (grep {$$meta{'context'} eq $_;} @{$$self{'no_words'};}) { }
149 0 elsif (@words and not $$meta{'pretend'}) { }
538 0 46 $$meta{'pretend'} ? :
541 0 46 if $$meta{'context'} eq 'SUBZ'
542 46 0 if not $$meta{'pretend'} and $$meta{'context'} eq 'PERL'
546 149 0 unless $$meta{'plain_words'}
547 139 10 @words > 1 && !($words[-1] =~ /^-/) ? :
550 119 30 if $$meta{'context'} eq 'CMD' and $$meta{'cmdtype'} ne 'builtin' and not exists $$self{'commands'}{$words[0]}
566 0 134 if (@words > 1 or not $$meta{'split_words'}) { }
576 134 0 if ($$meta{'parse_env'})
582 0 134 if (not @words and $$meta{'env'}) { }
6 128 elsif ($$meta{'env'}) { }
594 134 0 unless defined $$meta{'env'}{$_}
599 0 134 unless $$meta{'parse_fd'}
601 134 0 unless grep {not ref $_;} map(@$_, @s_words)
609 0 0 unless defined $parts[$_] and not ref $parts[$_]
611 0 0 if ($op =~ /[^A-Z_]/) { }
0 0 elsif ($op eq 'ERROR') { }
616 0 0 unless $$meta{'pretend'}
621 0 0 if ($_ > 0 and ref $parts[$_ - 1])
622 0 0 if (${$parts[$_ - 1];} =~ /^\d+$/) { }
624 0 0 unless $1
629 0 0 if ($_ < $#parts and ref $parts[$_ + 1]) { }
0 0 elsif (@s_words and ref $s_words[0][0]) { }
631 0 0 if $_ + 1 == $last and not @s_words
635 0 0 if @s_words == 1 and not @{$s_words[0];}
638 0 0 unless $op =~ /^DUP/ or $$meta{'pretend'}
643 0 0 unless ($$meta{'pretend'})
644 0 0 $op =~ /OUT$/ ? :
646 0 0 if (@w == 1) { }
0 0 elsif (@w > 1) { }
652 0 0 if @s_words
659 0 208 $$self{'_settings'}{'mode'} && !$$meta{'no_mode'} ? :
662 195 13 unless ref $aliases and exists $$aliases{$words[0]}
664 0 13 if grep {$_ eq $words[0];} @{$$meta{'alias_stack'};}
689 13 0 ref $_ ? :
690 13 0 $$meta{'split_script'} ? :
696 13 0 if (my($firstref) = grep(ref($_), @l))
698 0 13 if @$firstref > 1 and $$firstref[1] =~ s/^\!\s*//
702 0 13 if ($string =~ /\s$/) { }
13 0 elsif (@l == 1) { }
704 0 0 if ref $l[-1] and ref $l1[0]
709 0 0 if (ref $l[-1]) { }
722 0 0 if $re
733 39 719 if (m[^([/\w]+=)?(['"])(.*)\2$]s)
736 29 10 if ($2 eq q[']) { }
811 29 714 if (m[^([/\w]+=)?'.*'$]s) { }
814 0 0 $$self{'error'} ? :
0 0 ref $$self{'error'} ? :
817 0 32 if $w =~ /[^\w-]/
818 0 0 $i ? :
0 32 if ($w eq '_') { }
32 0 elsif (exists $$meta{'env'}{$w} or exists $ENV{$w}) { }
0 0 elsif ($i ? defined *{$class . '::' . $w;}{'ARRAY'} : defined *{$class . '::' . $w;}{'SCALAR'}) { }
820 0 32 exists $$meta{'env'}{$w} ? :
821 11 21 $i ? :
824 0 0 $i ? :
830 691 23 if ($_ eq $old or $_ =~ /^".*"$/) { }
837 1 740 if (/^ \@ (?: \{ (.*?) \} | ([\w-]+) ) $/x) { }
839 0 1 if $w =~ /[^\w-]/
840 0 1 if $2 eq '_'
841 1 0 if (exists $$meta{'env'}{$w} or exists $ENV{$w}) { }
0 0 elsif (defined *{$class . '::' . $w;}{'ARRAY'}) { }
842 0 1 exists $$meta{'env'}{$w} ? :
852 0 164 if $e
861 29 726 if (m[^([/\w]+=)?'.*'$]s) { }
0 726 elsif (/^\@\((.*?)\)$/s) { }
869 9 717 if s/^(")(.*)\1$/$2/s
871 0 726 if $$self{'stringparser'}{'broken'}
873 726 0 unless (@parts > 1)
874 9 717 $quote ? :
878 0 0 if ($parts[$_] eq 'COMM') { }
0 0 elsif (ref $parts[$_]) { }
881 0 0 if ($_ < $#parts - 1 and ${$parts[$_ + 2];} =~ s/^\[(\d*)\]//) { }
890 0 0 if ($quote) { }
906 0 164 if $$self{'_settings'}{'noglob'}
907 0 164 $$self{'_settings'}{'nullglob'} ? :
908 0 164 if $$self{'_settings'}{'nocaseglob'}
910 39 716 if (m[^([/\w]+=)?(['"])]) { }
0 716 elsif (/^m\{(.*)\}([imsx]*)$/) { }
11 705 elsif (/^~|[*?\[\]{}]/) { }
913 0 0 if (@r) { }
914 0 0 unless $1
918 0 4 $1 ? :
11 0 unless $$self{'_settings'}{'voidbraces'}
922 11 0 !($_ =~ /^-/) ? :
925 1 0 unless $1
933 46 0 if delete $opts{'Z'}
935 0 46 if delete $opts{'Z'}
938 46 0 unless $opts{'z'}
940 0 46 if ($opts{'g'}) { }
0 46 elsif ($opts{'p'}) { }
0 46 elsif ($opts{'n'}) { }
944 46 0 unless $opts{'z'}
954 92 56 ref $_ ? :
959 56 0 $_ < $#parts ? :
960 42 14 $_ ? :
963 49 7 if ($token =~ /^([\@\$])(\w+)/) { }
1 6 elsif ($prev =~ /[\w\}\)\]]$/) { }
965 41 8 if ($next =~ /^::/ or grep {$name eq $_;} '_', 'ARGV', 'ENV', 'SIG', 'INC', 'JOBS' or not exists $ENV{$name} || exists $$meta{'env'}{$name}) { }
1 7 elsif ($sigil eq '@' or $next =~ /^\[/) { }
973 1 0 unless defined *{$class . '::' . $name;}{'ARRAY'} and @{$class . '::' . $name;}
994 0 90 if ($$self{'parser'}{$context}{'handler'}) { }
90 0 elsif ($self->can('_do_' . lc($context))) { }
1004 0 0 $context ? :
1015 0 0 if $cmd =~ /^\s*\((.*)\)\s*$/s
1019 0 0 if $$self{'error'}
1029 1 43 if ($cmd =~ m[/]) { }
30 13 elsif ($$meta{'cmdtype'} eq 'builtin' or exists $$self{'commands'}{$cmd}) { }
1030 0 1 if $$meta{'cmdtype'} eq 'builtin'
1031 0 1 unless -e $cmd
1032 0 1 if -d _
1033 0 1 unless -x _
1035 0 0 unless exec do { $cmd } $cmd, @args
1038 0 30 unless exists $$self{'commands'}{$cmd}
1045 0 0 unless exec do { $cmd } $cmd, @args
1052 0 46 if $_Code =~ /package/
1059 0 46 if ref $$shell{'error'}
1060 0 46 ref $_Code ? :
1061 0 46 if ($@) { }
1062 0 0 if ref $@
1068 0 46 if $_Class
1069 0 46 if $$shell{'_settings'}{'interactive'}
1086 0 0 unless (@_)
1087 0 0 if $$self{'_settings'}{'mode'}
1091 0 0 if ($mode eq '-' or $mode eq 'default') { }
1095 0 0 $mode =~ /::/ ? :
1097 0 0 unless grep {lc $mode eq $_;} 'perl', 'cmd', 'sh' or $$self{'parser'}{$m}{'handler'}
1112 0 32 if ($$opts{'list'}) { }
1114 0 0 if (@$args)
1118 0 0 if ($$opts{'verbose'})
1120 0 0 exists $$raw{$_} ? :
1128 0 32 unless @$args
1129 32 0 unless exists $$self{'objects'}{$$args[0]}
1144 0 0 if ($$opt{'all'}) { }
1146 0 0 unless @$args == 1
1156 0 0 if length $prompt
1157 0 0 length $preput ? :
1174 1375056 311 unless exists $$self{'events'}{$event}
1178 0 327 if $@
1195 0 9 unless ref $self
1198 0 9 if (exists $$self{'objects'}{$call}) { }
1224 0 0 if (@{$$self{'jobs'};} and not $$self{'_warned_bout_jobs'}) { }
1245 2 0 if ($$self{'round_up'})
1254 0 1 if ($$self{'round_up'})
1328 0 0 if $_[0] =~ /^\d+$/
1329 0 0 if (wantarray) { }
1338 0 0 if $cmd eq 'DESTROY'
1339 0 0 if ref $_[0] eq 'Zoidberg::Eval'
1342 0 0 if lc $$Zoidberg::CURRENT{'settings'}{'mode'} eq 'perl'