Branch Coverage

blib/lib/Argv.pm
Criterion Covered Total %
branch 175 534 32.7


line true false branch
6 0 1 $^O =~ /MSWin|Windows_NT/i ? :
7 0 1 $^O =~ /cygwin/i ? :
61 0 1 @_ ? :
68 0 130 unless @_ or defined wantarray
70 139 2 if (ref $self) { }
71 9 130 if (@_) { }
72 4 5 if (defined wantarray) { }
73 0 4 if (ref $$self{$attr}) { }
0 4 elsif (defined $$self{$attr}) { }
86 14 116 defined $$self{$attr} ? :
90 2 0 if (@_) { }
91 0 2 if (defined wantarray) { }
92 0 0 if (ref $$class{$attr}) { }
109 4 126 if (ref $ret eq 'ARRAY' and ref $$ret[0] ne 'CODE')
112 4 0 if (ref $self) { }
113 0 4 if (@$stack) { }
141 0 2 if (not $nfd =~ /^[\d-]*$/) { }
0 2 elsif ($fd == 0) { }
0 2 elsif ($nfd == 0) { }
0 2 elsif ($nfd == 3 - $fd) { }
0 2 elsif ($nfd != $fd) { }
144 0 0 if $nfd > 0
145 0 0 if $nfd < 0
160 0 21 /^--$/ ? :
162 0 11 /^=--=$/ ? :
175 0 0 if ($ipc_state)
177 0 0 if $@
182 0 0 if (ref $self) { }
183 0 0 if (defined $ipc_state) { }
187 0 0 exists $$self{'_IPC_CHILDSAFE'} ? :
191 0 0 if (defined $ipc_state) { }
205 0 0 if (ref $_[0] eq 'HASH')
215 0 0 if (ref $self) { }
0 0 elsif ($r_argv) { }
0 0 elsif (@ARGV) { }
216 0 0 if ($r_argv) { }
222 0 0 if (@ARGV)
247 0 0 unless (defined wantarray)
251 0 0 unless $Argv::Summary
260 0 0 if defined $cmds
268 0 8 if ref $_[0] eq 'HASH'
270 1 7 if (ref $proto) { }
282 1 0 if ($@)
288 1 0 if ($@)
295 0 1 if $@
299 0 1 if $@ or not $self
304 0 7 if ($proto ne 'Argv')
317 0 8 if $attrs
318 7 1 if @_
329 0 0 if $cmd eq 'DESTROY'
334 0 0 if (ref $self) { }
351 0 0 if ($attrs)
365 8 0 if (@_) { }
366 0 8 if ref $_[0] eq 'HASH'
370 8 0 if @_
371 0 8 if ref $_[0] eq 'HASH'
372 2 6 if ref $_[0] eq 'ARRAY'
373 5 3 if @_
377 0 0 if (wantarray) { }
389 9 1 if (@_) { }
0 1 elsif (not defined wantarray) { }
390 0 9 ref $_[0] ? :
395 9 1 if (@_) { }
398 1 0 wantarray ? :
405 6 2 if (@_) { }
0 2 elsif (not defined wantarray) { }
406 0 6 ref $_[0] eq 'ARRAY' ? :
411 6 2 if (@_) { }
426 0 11 if defined $$self{'AV_OPTS'}{$set}
435 5 0 if (@_)
436 0 5 if (ref $_[0] eq 'ARRAY') { }
0 5 elsif (ref $_[0] eq 'HASH') { }
446 5 0 if (defined $$self{'AV_OPTS'}{$set})
451 5 6 unless $main::Argv::{$p_meth}
455 2 4 if (@_ or not defined wantarray)
458 2 4 @_ ? :
459 5 6 unless $main::Argv::{$o_meth}
462 0 0 if (@_ > 1) { }
470 5 6 unless $main::Argv::{$f_meth}
487 5 0 if ($r_desc and @$r_desc)
491 0 5 if ($r_cfg and @$r_cfg) { }
498 0 5 if $self->dbglevel == 5
506 11 10 if (@vgra and $vgra[$#vgra] eq $_) { }
512 5 0 if $r_opts
521 0 0 unless defined $$self{'AV_LKG'}{$set}
532 10 0 unless $norm and not ref $norm
542 0 0 if (m[^"?/]) { }
543 0 0 if (m[(.*/\w+):(.+)]) { }
556 0 0 if $slashes > 1
571 0 2 if s/^\^//
576 0 2 if (/^'(.*)'$/s) { }
0 2 elsif (/^".*"$/s) { }
589 2 0 unless m[[^-=:_."\w\\/]] or /\\n/ or tr/\n//
592 0 0 if /^\d?(?:<{1,2})|(?:>{1,2})/
609 0 1 @_ ? :
610 0 1 unless (@orig)
616 0 1 if (/^'(.*)'$/) { }
1 0 elsif (/[*?]/) { }
624 0 1 if (defined wantarray) { }
635 8 3 if (not @_) { }
2 1 elsif ($_[0] eq '-') { }
0 1 elsif ($_[0] eq '+') { }
643 0 1 unless $known{$_}
647 7 2 unless $$self{'AV_OPTS'}{$set} and @{$$self{'AV_OPTS'}{$set};}
671 1 1 if (my $val = $specific || $general)
672 0 1 if (ref $val eq 'CODE') { }
1 0 elsif (ref $val eq 'ARRAY') { }
0 0 elsif (ref $val eq 'SCALAR') { }
0 0 elsif (not $val =~ /^\d*$/) { }
0 0 elsif ($val) { }
694 0 0 if -e $chomped
710 0 2 if (@_) { }
714 0 2 if (exists $$self{'AV_READONLY'}) { }
718 0 2 if ($class and exists $$class{'AV_READONLY'}) { }
737 0 8 if /\s/ and not /^"/
741 0 4 if ($envp)
743 0 0 if $ENV{$_} and $ENV{$_} eq $$envp{$_}
748 0 4 if $level >= 3
750 0 4 if (not $ifd =~ /^[\d-]*$/) { }
0 4 elsif ($ifd < 0) { }
756 0 4 if (not $ofd =~ /^[\d-]*$/) { }
1 3 elsif ($ofd <= 0) { }
0 3 elsif ($ofd != 1) { }
764 0 4 if (not $efd =~ /^[\d-]*$/) { }
0 4 elsif ($efd <= 0) { }
0 4 elsif ($efd != 2) { }
790 1 0 unless (defined $_argmax)
799 1 1 unless (defined $_pathmax)
818 18 1 if $ENV{$ev}
836 0 0 if ($chunklen + length(${$args;}[0]) + $extra >= $max) { }
838 0 0 unless @chunk
852 0 1 if not ref $_[0] or ref $_[0] eq 'HASH'
854 0 1 if (ref $self ne $class and $self->ipc_childsafe) { }
863 1 0 if ($self->noexec and not $self->_read_only) { }
867 0 0 if $dbg
871 0 0 if (not $ifd =~ /^[\d-]*$/) { }
0 0 elsif ($ifd < 0) { }
872 0 0 unless open STDIN, $ifd
874 0 0 unless open STDIN, "<$NUL"
876 0 0 if $ifd > 0
878 0 0 if (not $ofd =~ /^[\d-]*$/ || $self->quiet) { }
0 0 elsif ($ofd <= 0 or $self->quiet) { }
0 0 elsif ($ofd == 2) { }
0 0 elsif ($ofd != 1) { }
879 0 0 unless open STDOUT, $ofd
881 0 0 unless open STDOUT, ">$NUL"
883 0 0 unless open STDOUT, '>&STDERR'
887 0 0 if (not $efd =~ /^[\d-]*$/) { }
0 0 elsif ($efd <= 0) { }
0 0 elsif ($efd == 1) { }
0 0 elsif ($efd > 2) { }
888 0 0 unless open STDERR, $efd
890 0 0 unless open STDERR, ">$NUL"
892 0 0 unless open STDERR, '>&STDOUT'
897 0 0 if ($envp) { }
904 0 0 if ($rc)
917 0 2 if (defined wantarray) { }
920 0 0 if (wantarray) { }
935 0 0 if (@_) { }
945 0 0 if $self->noexec and not $self->_read_only
952 0 9 if not ref $_[0] or ref $_[0] eq 'HASH'
957 0 9 if $self->autoglob
961 0 9 ref $self ne $class && $self->ipc_childsafe && !$self->mustexec ? :
966 0 9 if $childsafe and $self->autoquote
971 0 9 if ($childsafe) { }
972 0 0 if $Argv::Summary
973 0 0 if $envp
974 0 0 if $ifd
977 0 0 if ($self->quiet) { }
0 0 elsif (not $ofd =~ /^[\d-]*$/) { }
0 0 elsif ($ofd == 2) { }
980 0 0 if (open OFD, $ofd) { }
981 0 0 if @{$results{'stdout'};}
987 0 0 if @{$results{'stdout'};}
989 0 0 if $ofd > 2
990 0 0 if @{$results{'stdout'};}
992 0 0 if ($efd == 1) { }
0 0 elsif (not $efd =~ /^[\d-]*$/) { }
993 0 0 if @{$results{'stderr'};}
995 0 0 if (open EFD, $efd) { }
996 0 0 if @{$results{'stderr'};}
1002 0 0 if $efd > 2
1003 0 0 if @{$results{'stderr'};}
1007 0 9 if defined $dbg and $dbg > 2
1008 1 8 if ($self->noexec and not $self->_read_only)
1016 0 8 if (not $ifd =~ /^[\d-]*$/) { }
0 8 elsif ($ifd < 0) { }
1017 0 0 unless open STDIN, $ifd
1019 0 0 unless open STDIN, "<$NUL"
1021 0 8 if $ifd > 0
1024 0 8 if (not $ofd =~ /^[\d-]*$/ || $self->quiet) { }
4 4 elsif ($ofd <= 0 or $self->quiet) { }
0 4 elsif ($ofd == 2) { }
0 4 elsif ($ofd != 1) { }
1025 0 0 unless open STDOUT, $ofd
1027 0 4 unless open STDOUT, ">$NUL"
1029 0 0 unless open STDOUT, '>&STDERR'
1034 0 8 if (not $efd =~ /^[\d-]*$/) { }
2 6 elsif ($efd <= 0) { }
0 6 elsif ($efd == 1) { }
0 6 elsif ($efd > 2) { }
1035 0 0 unless open STDERR, $efd
1037 0 2 unless open STDERR, ">$NUL"
1039 0 0 unless open STDERR, '>&STDOUT'
1045 0 8 if ($limit and @args) { }
1046 0 0 if ($limit == -1)
1053 0 0 $limit > 0 ? :
1056 0 0 if $Argv::Summary
1058 0 0 if $dbg
1059 0 0 if ($envp) { }
1067 0 8 if $Argv::Summary
1068 2 6 if $dbg
1069 0 8 if ($envp) { }
1080 0 8 if $dbg > 1
1081 2 6 if ($?)
1090 0 1 if not ref $_[0] or ref $_[0] eq 'HASH'
1096 0 1 ref $self ne $class && $self->ipc_childsafe && !$self->mustexec ? :
1103 1 0 if @prog + @opts + @args > 1 || $childsafe and $self->autoquote
1112 0 1 if ($childsafe) { }
1113 0 0 if $Argv::Summary
1114 0 0 if $envp
1115 0 0 if $ifd
1116 0 0 if ($noexec) { }
1120 0 0 if ($ofd <= 0) { }
0 0 elsif ($ofd == 1) { }
0 0 elsif ($ofd == 2) { }
1129 0 0 if ($efd == 1) { }
1132 0 0 if $efd
1133 0 0 if $efd > 2
1140 0 1 if defined $dbg and $dbg > 2
1142 1 0 if ($limit and @args) { }
1143 1 0 if ($limit == -1)
1151 2 0 $limit > 0 ? :
1154 0 1 if $Argv::Summary
1156 0 1 if ($noexec) { }
1159 0 1 if $dbg
1162 0 1 if ($envp) { }
1172 0 0 if $Argv::Summary
1173 0 0 if ($noexec) { }
1176 0 0 if $dbg
1179 0 0 if ($envp) { }
1188 0 1 if $rc and not $?
1190 0 1 if $dbg > 1
1191 0 1 if ($?)
1196 1 0 if (wantarray) { }
1197 0 1 if @data and $dbg >= 2
1198 0 1 if $self->autochomp
1202 0 0 if @data and $dbg >= 2
1203 0 0 if $self->autochomp
1211 0 0 if not ref $_[0] or ref $_[0] eq 'HASH'
1216 0 0 unless ref $cb eq 'CODE'
1222 0 0 if $self->autochomp
1224 0 0 unless ($keepGoing)
1225 0 0 if ($self->_read_only)
1240 0 0 unless $rc
1246 0 0 if not ref $_[0] or ref $_[0] eq 'HASH'
1255 0 0 if @prog + @opts + @args > 1 and $self->autoquote
1263 0 0 if $Argv::Summary
1264 0 0 if ($noexec) { }
1268 0 0 if $dbg
1272 0 0 if ($envp) { }
1278 0 0 unless $rc and defined $handle
1280 0 0 wantarray ? :
1320 0 0 if $ENV{'ARGV_WIN32UTILS_SKIP_KILLPROCESSTREE'}
1325 0 0 if $argv->dbglevel > 1
1336 0 0 if $argv->dbglevel > 1
1400 0 0 unless $@