Branch Coverage

blib/lib/Sys/Cmd.pm
Criterion Covered Total %
branch 99 154 64.2


line true false branch
22 0 0 @_ ? :
26 0 0 @_ ? :
45 2 0 if exists &{$c . '::_NEW';}
46 0 2 if exists &{$c . '::BUILD';}
48 0 2 if (exists &{$c . '::DOES';})
55 0 35 @_ > 1 ? :
35 0 @_ ? :
69 0 2 @_CLASS > 1 ? :
70 0 2 if exists $Sys::Cmd::_FIELDS->{'FIELDS'}
72 0 35 if (my(@missing) = grep({not exists $_[0]{$_};} "cmd"))
77 0 35 if $@
79 11 24 if exists $_[0]{'dir'}
80 2 33 if $@
83 0 33 if exists $_[0]{'encoding'}
84 0 33 if $@
87 19 14 if exists $_[0]{'env'}
88 0 33 if $@
90 0 33 if exists $_[0]{'mock'}
91 0 33 if $@
102 0 32 if @_ > 1
105 0 98 if @_ > 1
106 0 32 if @_ > 1
109 0 65 if @_ > 1
114 0 65 if $@
119 0 62 if @_ > 1
120 0 7 if @_ > 1
121 0 7 if @_ > 1
122 0 31 if @_ > 1
123 0 0 if @_ > 1
126 0 0 if (@_ > 1)
128 0 0 if $@
136 0 32 if (@_ > 1)
139 0 7 if @_ > 1
206 28 72 if (ref $arg eq 'HASH') { }
207 0 28 if $opts
217 2 39 if ($template)
219 0 2 if (exists $opts->{'env'})
226 0 39 unless @cmd and defined $cmd[0]
228 37 2 if ("CODE" ne ref $cmd[0] and not $opts->{'mock'})
231 5 32 if ("File::Spec"->splitdir($cmd[0]) == 1)
237 2 31 unless (-x $cmd[0])
264 0 30 unless pipe my $child_in, $stdin
265 0 30 unless pipe $stdout, my $child_out
266 0 30 unless pipe $stderr, my $child_err
288 858 0 defined $ENV{$_} ? :
310 0 30 if $err
311 0 30 unless defined $pid
328 0 2 unless pipe my $child_in, $stdin
329 0 2 unless pipe $stdout, my $child_out
330 0 2 unless pipe $stderr, my $child_err
333 0 2 unless (defined $pid)
338 1 1 if ($pid > 0)
363 0 3 unless open $fh, $mode, $fileno
367 0 3 unless binmode $fh, ':encoding(' . $encoding . ')'
371 2 1 if $autoflush
392 8 24 if defined $dir
399 24 6 if (defined $val) { }
407 8 24 if defined $dir
421 2 30 $oe ? :
2 30 $self->_coderef ? :
426 7 24 if defined $dir
427 0 31 if $err
430 0 31 unless binmode $proc->stdin, $enc
431 0 31 unless binmode $proc->stdout, $enc
432 0 31 unless binmode $proc->stderr, $enc
437 8 23 if (defined(my $input = $self->input))
441 2 6 if ('ARRAY' eq ref $input and @$input) { }
4 2 elsif (length $input) { }
468 196 10 $fh == $stdout ? :
469 192 14 if (defined(my $line = readline $fh)) { }
482 3 4 if (my $ref = $self->exit) { }
0 4 elsif (not $ok) { }
489 3 4 if (my $ref = $self->err) { }
1 3 elsif (@err) { }
497 4 3 if (my $ref = $self->out) { }
2 1 elsif (defined(my $wa = wantarray)) { }
501 1 1 if $wa