Condition Coverage

blib/lib/HTTP/Tiny.pm
Criterion Covered Total %
condition 191 293 65.1


and 3 conditions

line !l l&&!r l&&r condition
83 1 0 0 not $persist_ok{$accessor} and $_[1] ne $_[0]{$accessor}
95 1 142 2 defined $agent && $agent =~ / $/
209 0 0 0 @_ == 3 and ref $args eq "HASH"
2 1 6 @_ == 3 and ref $args eq "HASH"
0 0 0 @_ == 3 and ref $args eq "HASH"
0 0 0 @_ == 3 and ref $args eq "HASH"
0 0 2 @_ == 3 and ref $args eq "HASH"
0 0 8 @_ == 3 and ref $args eq "HASH"
241 0 0 1 @_ == 4 and ref $args eq "HASH"
286 3 1 1 @_ == 4 and ref $args eq "HASH"
297 2 0 3 -e $file and my $mtime = (stat $file)[9]
315 0 0 3 $lm and my $mtime = $self->_parse_http_date($lm)
431 3 1 111 @_ == 4 and ref $args eq "HASH"
439 129 0 10 $@ and $idempotent{$method}
0 10 0 $@ and $idempotent{$method} and $@ =~ /^(?:Socket closed|Unexpected end|SSL read error)/
445 10 0 0 ref $e eq "HASH" and exists $e->{'status'}
484 0 0 6 @_ == 2 and ref $data
546 10 3 0 ref $self and $self->{'verify_SSL'} || $self->{'SSL_options'}{'SSL_verify_mode'}
609 139 10 1 $scheme ne "http" and $scheme ne "https"
664 106 0 34 $self->{'keep_alive'} and $handle->connected
106 2 32 $self->{'keep_alive'} and $handle->connected and $known_message_length
2 2 30 $self->{'keep_alive'} and $handle->connected and $known_message_length and $response->{'protocol'} eq "HTTP/1.1"
4 1 29 $self->{'keep_alive'} and $handle->connected and $known_message_length and $response->{'protocol'} eq "HTTP/1.1" and ($response->{'headers'}{'connection'} || '') ne "close"
702 144 0 2 $self->{'_has_proxy'}{$scheme} and not grep({$host =~ /\Q$_\E$/;} @{$$self{"no_proxy"};})
728 1 0 1 length $p_auth and not defined $request->{'headers'}{'proxy-authorization'}
750 1 0 21 defined $scheme and length $scheme
1 0 21 defined $scheme and length $scheme and length $host
0 0 21 defined $scheme and length $scheme and length $host and length $port
0 0 21 defined $scheme and length $scheme and length $host and length $port and $path_query eq "/"
821 15 1 26 defined $args->{'content'} and length $args->{'content'}
828 5 0 0 exists $request->{'content-length'} and $request->{'content-length'} == 0
862 139 1 4 length $auth and not defined $request->{'headers'}{'authorization'}
882 134 1 4 $data_cb and $response->{'status'} =~ /^2/
915 0 2 27 ref $jar and ref($jar)->can($method)
928 128 0 13 $status eq '303' || $status =~ /^30[1278]/ && $method =~ /^GET|HEAD$/ and $headers->{'location'}
0 2 11 $status eq '303' || $status =~ /^30[1278]/ && $method =~ /^GET|HEAD$/ and $headers->{'location'} and @{$args->{'_redirects'};} < $self->{'max_redirect'}
959 160 4 21 $host =~ s/:(\d*)\z// && length $1
1068 0 2 0 $self->{'fh'} and $self->{'fh'}->can("timeout")
1117 0 0 8 $self->{'fh'} and $self->{'fh'}->connected
1237 670 4 0 $len and not $allow_partial
1343 0 0 148 @_ >= 2 and @_ <= 4
0 0 148 @_ >= 2 and @_ <= 4 and ref $_[1] eq "HASH"
1447 2 21 150 defined $data and length $data
1494 4 1 54 defined $data and length $data
1554 338 0 0 defined $timeout and $timeout >= 0
1557 0 0 338 defined $fd and $fd >= 0

or 2 conditions

line l !l condition
120 3 139 $args{'verify_SSL'} || $args{'verify_ssl'} || 0
158 1 1 $ENV{'CGI_HTTP_PROXY'} || ''
209 0 1 $args || {}
6 68 $args || {}
0 2 $args || {}
0 0 $args || {}
2 0 $args || {}
8 0 $args || {}
433 111 28 $args ||= {}
664 1 29 $response->{'headers'}{'connection'} || ''
832 5 0 $request->{'headers'}{'content-type'} ||= "application/octet-stream"
845 7 14 $request->{'headers'}{'content-type'} ||= "application/octet-stream"
926 11 130 $args->{'_redirects'} ||= []
1276 16 152 $headers ||= {}
1345 23 125 $header_case ||= {}
1399 14 125 $response->{'headers'}{'transfer-encoding'} || ''

or 3 conditions

line l !l&&r !l&&!r condition
145 1 1 137 $ENV{'all_proxy'} || $ENV{'ALL_PROXY'}
159 2 4 131 $ENV{'http_proxy'} || $ENV{'HTTP_PROXY'} || $self->{'proxy'}
172 1 4 134 $ENV{'https_proxy'} || $ENV{'HTTPS_PROXY'} || $self->{'proxy'}
209 1 0 0 @_ == 2 or @_ == 3 and ref $args eq "HASH"
68 7 2 @_ == 2 or @_ == 3 and ref $args eq "HASH"
2 0 0 @_ == 2 or @_ == 3 and ref $args eq "HASH"
0 0 0 @_ == 2 or @_ == 3 and ref $args eq "HASH"
0 2 0 @_ == 2 or @_ == 3 and ref $args eq "HASH"
0 8 0 @_ == 2 or @_ == 3 and ref $args eq "HASH"
241 5 1 0 @_ == 3 or @_ == 4 and ref $args eq "HASH"
286 4 1 4 @_ == 3 or @_ == 4 and ref $args eq "HASH"
298 1 2 0 $args->{'headers'}{'if-modified-since'} ||= $self->_http_date($mtime)
319 3 1 1 $response->{'success'} ||= $response->{'status'} eq 304
431 28 112 3 @_ == 3 or @_ == 4 and ref $args eq "HASH"
486 2 4 0 ref $data eq "HASH" or ref $data eq "ARRAY"
546 2 0 1 $self->{'verify_SSL'} || $self->{'SSL_options'}{'SSL_verify_mode'}
597 3 141 0 ref $_[0] || $_[0]
623 0 149 0 $args->{'peer'} || $host
640 3 144 2 $handle ||= $self->_open_handle($request, $scheme, $host, $port, $peer)
653 1 1 139 $method eq "HEAD" or $response->{'status'} =~ /^[23]04/
815 0 144 0 $request->{'headers'}{'user-agent'} ||= $self->{'agent'}
820 8 34 102 $request->{'method'} eq "PUT" or $request->{'method'} eq "POST"
835 2 0 3 exists $request->{'headers'}{'content-length'} or $request->{'headers'}{'transfer-encoding'}
848 1 0 20 $request->{'headers'}{'content-length'} or $request->{'headers'}{'transfer-encoding'}
928 2 20 119 $status eq '303' || $status =~ /^30[1278]/ && $method =~ /^GET|HEAD$/
1202 278 396 0 @_ == 2 or @_ == 3
1274 152 16 0 @_ == 1 or @_ == 2
1383 1 370 0 $_ eq "" or /\A $Field_Content \z/ox
1419 125 279 0 @_ == 3 or @_ == 4
1421 279 106 19 $content_length ||= $response->{'headers'}{'content-length'}
1573 0 0 0 not $timeout or ($pending = $timeout - (time - $initial)) > 0
1583 368 0 0 @_ == 1 or @_ == 2
1592 8 0 0 @_ == 1 or @_ == 2
1612 0 0 13 $self->{'pid'} != $$ or $self->{'tid'} != _get_tid()
0 0 13 $self->{'pid'} != $$ or $self->{'tid'} != _get_tid() or length $self->{'rbuf'}
0 1 12 $self->{'pid'} != $$ or $self->{'tid'} != _get_tid() or length $self->{'rbuf'} or $scheme ne $self->{'scheme'}
1 1 11 $self->{'pid'} != $$ or $self->{'tid'} != _get_tid() or length $self->{'rbuf'} or $scheme ne $self->{'scheme'} or $host ne $self->{'host'}
2 1 10 $self->{'pid'} != $$ or $self->{'tid'} != _get_tid() or length $self->{'rbuf'} or $scheme ne $self->{'scheme'} or $host ne $self->{'host'} or $port ne $self->{'port'}
2 0 10 $self->{'pid'} != $$ or $self->{'tid'} != _get_tid() or length $self->{'rbuf'} or $scheme ne $self->{'scheme'} or $host ne $self->{'host'} or $port ne $self->{'port'} or $peer ne $self->{'peer'}
1 7 3 $self->{'pid'} != $$ or $self->{'tid'} != _get_tid() or length $self->{'rbuf'} or $scheme ne $self->{'scheme'} or $host ne $self->{'host'} or $port ne $self->{'port'} or $peer ne $self->{'peer'} or eval { do { $self->can_read(0) } }
7 0 3 $self->{'pid'} != $$ or $self->{'tid'} != _get_tid() or length $self->{'rbuf'} or $scheme ne $self->{'scheme'} or $host ne $self->{'host'} or $port ne $self->{'port'} or $peer ne $self->{'peer'} or eval { do { $self->can_read(0) } } or $@