Branch Coverage

blib/lib/Proc/SyncExec.pm
Criterion Covered Total %
branch 31 64 48.4


line true false branch
78 0 27 if @_ > 2
82 27 0 if not defined $max_retries or $max_retries < 0
83 27 0 if not defined $sleep or $sleep < 0
87 0 0 if $retries++ >= $max_retries
124 5 15 @_ && ref $_[0] eq 'CODE' ? :
125 0 20 unless @_
129 0 20 unless pipe $reader, $writer
132 5 15 unless ($pid)
134 5 0 if $ok
135 5 0 if $ok
136 2 3 if $ok and $code
138 0 0 unless ($ok and exec @cmd)
145 0 15 unless close $writer
150 15 0 if defined $nread
151 0 0 if $! == 4
154 0 15 unless close $reader
155 11 4 if ($nread)
157 0 0 if $! == 4
179 0 5 unless @_ >= 3
185 2 3 if ($type eq 'w') { }
3 0 elsif ($type eq 'r') { }
199 0 5 unless $result
201 2 0 if close $fh_parent and open $fh_dup_to, $fh_dup_type . fileno($fh_child)
206 0 3 unless close $fh_child
226 0 0 unless @_ >= 2
229 0 0 unless my $pid = sync_fhpopen_noshell($fh, $type, @cmd)
231 0 0 wantarray ? :
251 0 5 unless @_ == 1 or @_ == 2
253 5 0 @_ ? :
258 2 3 if ($cmd =~ s/^\|//) { }
3 0 elsif ($cmd =~ s/\|$//) { }
259 0 2 if (substr($cmd, -1) eq '|')