Condition Coverage

blib/lib/IO/Async/Process.pm
Criterion Covered Total %
condition 28 38 73.6


and 3 conditions

line !l l&&!r l&&r condition
352 18 0 0 exists $self->{'fd_opts'}{$_} and croak("Cannot configure stdio since fd$_ is already defined")
392 202 28 4 defined $via and $via == 4
399 21 2 179 $wants_read and not $wants_write
400 181 0 21 not $wants_read and $wants_write
401 21 179 2 $wants_read and $wants_write
416 229 5 0 $via == 3 and $fd ne "io"
769 233 0 1 defined $opts->{'socktype'} and "IO::Async::OS"->getsocktypebyname($opts->{'socktype'}) != 1

or 2 conditions

line l !l condition
358 0 234 $self->{'fd_opts'}{$fd} ||= {}

or 3 conditions

line l !l&&r !l&&!r condition
351 36 136 53 $fd == 0 or $fd == 1
398 3 4 0 $via == 3 or $via == 4
512 160 115 0 $self->{'code'} or $self->{'command'}
616 8 248 0 $self->{'finish_future'} //= $self->loop->new_future
764 203 234 0 $self->{'fd_handle'}{$fd} ||= do { croak("$self does not have an fd Stream for $fd") unless my $opts = $self->{'fd_opts'}{$fd}; my $handle_class; if (defined $opts->{'socktype'} and "IO::Async::OS"->getsocktypebyname($opts->{'socktype'}) != 1) { require IO::Async::Socket; $handle_class = "IO::Async::Socket"; } else { require IO::Async::Stream; $handle_class = "IO::Async::Stream"; } ; my $handle = $handle_class->new("notifier_name", $fd eq 0 ? "stdin" : ($fd eq 1 ? "stdout" : ($fd eq 2 ? "stderr" : ($fd eq "io" ? "stdio" : "fd$fd"))), %{$$opts{"handle"};}); if (defined $opts->{'from'}) { $handle->write($opts->{'from'}, "on_flush", sub { my($handle) = @_; $handle->close_write; } ); } ; $handle }