Condition Coverage

lib/HTTP/Promise/Request.pm
Criterion Covered Total %
condition 21 87 24.1


and 3 conditions

line !l l&&!r l&&r condition
73 32 0 0 @_ == 1 and ref $_[0] eq "HASH"
0 0 32 @_ >= 2 and defined $_[0]
0 10 22 @_ >= 2 and defined $_[0] and $_[0] =~ /^(?:$HTTP::Promise::Request::KNOWN_METHODS)$/ || $_[0] =~ /^[A-Za-z]{3,12}$/ && !($_[0] =~ /^(?:$HTTP::Promise::Request::KNOWN_METHODS_I)$/i)
10 22 0 @_ >= 2 and defined $_[0] and $_[0] =~ /^(?:$HTTP::Promise::Request::KNOWN_METHODS)$/ || $_[0] =~ /^[A-Za-z]{3,12}$/ && !($_[0] =~ /^(?:$HTTP::Promise::Request::KNOWN_METHODS_I)$/i) and defined $_[1] && $_[1] =~ m(^(?:$HTTP::Promise::Request::RE{'URI'}{'HTTP'}|$HTTP::Promise::Request::RE{'URI'}{'HTTP'}{join $;, '-scheme', 'https'}|(?:https?\:\/{2}\[?(?:$HTTP::Promise::Request::RE{'net'}{'IPv4'}|$HTTP::Promise::Request::RE{'net'}{'IPv6'}|\:{2}1)\]?(?:\:\d+)?)|$HTTP::Promise::Request::INTL_URI_RE|/)) || !defined($_[1])
218 0 0 0 $f and not $def->{'filename'}
0 0 0 $f and not $def->{'filename'} and !$def->{'headers'} || ref $def->{'headers'} ne 'ARRAY' && !$self->_is_a($def->{'headers'}, 'HTTP::Promise::Headers') || $self->_is_a($def->{'headers'}, 'HTTP::Promise::Headers') && $def->{'headers'}->content_disposition->index('filename') == -1
232 0 0 0 $f and not $def->{'type'}
0 0 0 $f and not $def->{'type'} and !$def->{'headers'} || ref $def->{'headers'} ne 'ARRAY' && !$self->_is_a($def->{'headers'}, 'HTTP::Promise::Headers') || $self->_is_a($def->{'headers'}, 'HTTP::Promise::Headers') && !$def->{'headers'}->content_type
252 0 0 0 defined $def and ref $def eq "HASH"
254 0 0 0 exists $def->{'headers'} and ref $def->{'headers'} eq "ARRAY"
0 0 0 exists $def->{'headers'} and $self->_is_a($def->{'headers'}, "HTTP::Promise::Headers")
264 0 0 0 $def->{'type'} and not $ph->exists("Content-Type")
267 0 0 0 $def->{'file'} and $def->{'encoding'}
0 0 0 $def->{'file'} and $def->{'encoding'} and $def->{'file'}->length
319 2 0 5 defined $str and length $str
358 3 0 3 defined $proto and length $proto

or 2 conditions

line l !l condition
166 0 0 $this->as_form_data || (return $self->pass_error($this->error))
168 0 0 $form_data->make_parts || (return $self->pass_error($form_data->error))
175 0 0 $this->make_parts || (return $self->pass_error($this->error))
256 0 0 'HTTP::Promise::Headers'->new(@{$$def{'headers'};}) || (return $self->pass_error('HTTP::Promise::Headers'->error))
275 0 0 'HTTP::Promise::Stream'->new($source, 'encoding', $def->{'encoding'}) || (return $self->pass_error('HTTP::Promise::Stream'->error))
298 0 0 'HTTP::Promise::Headers'->new || (return $self->pass_error('HTTP::Promise::Headers'->error))
326 3 2 $p->parse($str, %$opts ? $opts : ()) || (return $self->pass_error($p->error))
336 3 0 $self->method || $HTTP::Promise::Request::DEFAULT_METHOD || 'GET'
364 3 0 $self->default_protocol || 'HTTP/1.1'

or 3 conditions

line l !l&&r !l&&!r condition
73 18 4 10 $_[0] =~ /^(?:$HTTP::Promise::Request::KNOWN_METHODS)$/ || $_[0] =~ /^[A-Za-z]{3,12}$/ && !($_[0] =~ /^(?:$HTTP::Promise::Request::KNOWN_METHODS_I)$/i)
21 1 0 defined $_[1] && $_[1] =~ m(^(?:$HTTP::Promise::Request::RE{'URI'}{'HTTP'}|$HTTP::Promise::Request::RE{'URI'}{'HTTP'}{join $;, '-scheme', 'https'}|(?:https?\:\/{2}\[?(?:$HTTP::Promise::Request::RE{'net'}{'IPv4'}|$HTTP::Promise::Request::RE{'net'}{'IPv6'}|\:{2}1)\]?(?:\:\d+)?)|$HTTP::Promise::Request::INTL_URI_RE|/)) || !defined($_[1])
197 0 0 0 $v->finfo->mime_type || $HTTP::Promise::Request::DEFAULT_MIME_TYPE
218 0 0 0 !$def->{'headers'} || ref $def->{'headers'} ne 'ARRAY' && !$self->_is_a($def->{'headers'}, 'HTTP::Promise::Headers') || $self->_is_a($def->{'headers'}, 'HTTP::Promise::Headers') && $def->{'headers'}->content_disposition->index('filename') == -1
232 0 0 0 !$def->{'headers'} || ref $def->{'headers'} ne 'ARRAY' && !$self->_is_a($def->{'headers'}, 'HTTP::Promise::Headers') || $self->_is_a($def->{'headers'}, 'HTTP::Promise::Headers') && !$def->{'headers'}->content_type
317 0 2 0 ref $self || $self
324 0 0 5 delete $opts->{'debug'} || $self->debug