Condition Coverage

lib/HTTP/Promise/IO.pm
Criterion Covered Total %
condition 45 235 19.1


and 3 conditions

line !l l&&!r l&&r condition
88 158 0 0 $fh->isa("IO::Socket::SSL") and $fh->pending
89 158 0 0 $fh->isa("Net::SSL") and $fh->can("pending")
158 0 0 $fh->isa("Net::SSL") and $fh->can("pending") and $fh->pending
160 0 0 0 exists $opts->{'timeout'} and length $opts->{'timeout'}
170 0 0 0 defined $timeout and $timeout > 0
180 0 0 0 exists $opts->{'local_port'} and defined $opts->{'local_port'}
217 0 0 0 $HTTP::Promise::IO::IS_WIN32 and $! == 11
230 0 0 0 $! == 4 and not &$stop_if()
250 0 0 0 exists $opts->{'timeout'} and length $opts->{'timeout'}
297 0 0 0 exists $opts->{'timeout'} and length $opts->{'timeout'}
383 0 23 0 $max and $buff->length > $max
419 0 23 0 $max and $pos > $max
451 0 0 0 $nfound < 0 and $!
463 0 0 0 exists $opts->{'timeout'} and length $opts->{'timeout'}
486 0 0 0 $nfound == -1 and $! == 4
0 0 0 $nfound == -1 and $! == 4 and &$stop_if()
501 0 0 80 @_ > 2 and @_ < 5
503 0 0 80 defined $len and $len =~ /^\d+$/
505 52 28 0 defined $off and not $off =~ /^-?\d+$/
507 79 1 0 ref $_[1] and not $is_scalar
527 0 0 0 $HTTP::Promise::IO::IS_WIN32 and $! == 106
602 0 0 129 defined $what and length $what
633 1 113 15 $buff_len and $$buff =~ /$re/
643 113 0 1 not $n and $buff->is_empty
645 0 0 0 $HTTP::Promise::IO::IS_WIN32 and $! == 106
724 0 0 42 defined $what and length $what
763 2 0 0 $max and length $buff > $max
822 0 0 237 @_ > 1 and @_ < 6
838 0 0 0 $HTTP::Promise::IO::IS_WIN32 and $! == 106
861 0 0 0 @_ > 1 and @_ < 4
944 0 0 1 exists $hash{'stop_if'} and defined $hash{'stop_if'}
0 0 1 exists $hash{'stop_if'} and defined $hash{'stop_if'} and ref $hash{'stop_if'}
954 1 0 0 $serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
966 1 0 0 scalar @args == 1 && ref $args[0] eq 'ARRAY'
967 0 0 1 defined $ref && ref $ref eq 'ARRAY' && scalar @$ref > 1
983 1 0 0 exists $hash->{'stop_if_code'} and defined $hash->{'stop_if_code'}
1 0 0 exists $hash->{'stop_if_code'} and defined $hash->{'stop_if_code'} and length $hash->{'stop_if_code'}

or 2 conditions

line l !l condition
157 0 0 $opts->{'host'} || (return $self->error('No host to connect to was provided.'))
158 0 0 $opts->{'port'} || (return $self->error('No port to connect to was provided.'))
171 0 0 Socket::inet_aton($host) || (return $self->error("Cannot resolve host name: $host (port: $port): $!"))
173 0 0 Socket::pack_sockaddr_in($port, $ipbin) || (return $self->error("Cannot resolve host name: $host (port: $port): $!"))
189 0 0 Socket::pack_sockaddr_in($lport // 0, $laddr) || (return $self->error("Cannot resolve local host: $opts->{'local_host'} (port: $opts->{'local_port'}): $!"))
216 0 0 $self->new($sock, $params) || (return $self->pass_error)
247 0 0 $opts->{'host'} || (return $self->error('No host to connect to was provided.'))
248 0 0 $opts->{'port'} || (return $self->error('No port to connect to was provided.'))
264 0 0 $self->connect(%$params) || (return $self->pass_error)
268 0 0 ($opts->{'timeout'} // $self->timeout) // 5
290 0 0 $opts->{'proxy_host'} || (return $self->error('No proxy host to connect to was provided.'))
291 0 0 $opts->{'proxy_port'} || (return $self->error('No proxy port to connect to was provided.'))
292 0 0 $opts->{'host'} || (return $self->error('No host to connect to was provided.'))
293 0 0 $opts->{'port'} || (return $self->error('No port to connect to was provided.'))
311 0 0 $self->connect(%$params) || (return $self->pass_error)
372 24 0 $self->filehandle || (return $self->error('No filehandle currently set.'))
435 0 0 $self->filehandle || (return $self->error('No filehandle set to read from.'))
461 0 0 $self->filehandle || (return $self->error('No filehandle currently set.'))
469 0 0 ($self->inactivity_timeout // $opts->{'inactivity_timeout'}) // 600
508 28 52 $off //= 0
509 80 0 $self->filehandle || (return $self->error('No filehandle set to read from.'))
604 129 0 $self->filehandle || (return $self->error('No filehandle set to read from.'))
605 129 0 $opts->{'ignore'} //= 0
611 13 116 $opts->{'capture'} //= 0
625 0 129 $opts->{'chunk_size'} // 2048
677 127 1 $_[1] //= ""
726 0 42 $opts->{'ignore'} //= 0
732 5 37 $opts->{'capture'} //= 0
746 0 42 $opts->{'chunk_size'} // 2048
827 237 0 $self->filehandle || (return $self->error('No filehandle set to read from.'))
881 0 0 shift @_ || (return $self->error('No socket was provided.'))
940 1 0 shift @_ // ""

or 3 conditions

line l !l&&r !l&&!r condition
111 0 0 0 $flags == 0 || $flags & 2
128 0 0 0 $!{'EINTR'} or $!{'EAGAIN'}
0 0 0 $!{'EINTR'} or $!{'EAGAIN'} or $!{'EWOULDBLOCK'}
186 0 0 0 defined $lport or $laddr ne "\0\0\0\0"
217 0 0 0 $! == 115 or $HTTP::Promise::IO::IS_WIN32 and $! == 11
268 0 0 0 $opts->{'timeout'} // $self->timeout
374 0 24 0 $opts->{'max_read_buffer'} || $self->max_read_buffer
395 0 0 0 $!{'EINTR'} or $!{'EAGAIN'}
0 0 0 $!{'EINTR'} or $!{'EAGAIN'} or $!{'EWOULDBLOCK'}
436 0 0 0 $opts->{'timeout'} // $self->timeout
464 0 0 0 $timeout //= $self->timeout
469 0 0 0 $self->inactivity_timeout // $opts->{'inactivity_timeout'}
527 0 0 0 $! == 11 or $! == 11
0 0 0 $! == 11 or $! == 11 or $HTTP::Promise::IO::IS_WIN32 and $! == 106
645 0 0 0 $! == 11 or $! == 11
0 0 0 $! == 11 or $! == 11 or $HTTP::Promise::IO::IS_WIN32 and $! == 106
838 0 0 0 $! == 11 or $! == 11
0 0 0 $! == 11 or $! == 11 or $HTTP::Promise::IO::IS_WIN32 and $! == 106
928 0 0 0 exists $ssl_opts->{'SSL_ca_file'} or exists $ssl_opts->{'SSL_ca_path'}
967 0 0 0 ref $self || $self