Condition Coverage

blib/lib/YAHC.pm
Criterion Covered Total %
condition 72 202 35.6


and 2 conditions

line l !l condition
279 0 4 $target and scalar @{$target;}

and 3 conditions

line !l l&&!r l&&r condition
93 6 3 0 defined $args and ref $args ne 'HASH'
197 2 0 0 $stop_condition and $stop_condition->{'all'}
241 0 0 0 defined $args and ref $args eq 'HASH'
256 0 0 0 defined $args and ref $args eq 'HASH'
264 0 0 0 $conn->{'errors'} and @{$conn->{'errors'};}
281 4 0 0 $port ne '80' && $port ne '443'
287 0 0 0 $target and @{$target;}
294 0 0 0 $port ne '80' && $port ne '443'
394 3 10 0 $attempt > 1 and exists $conn->{'request'}{'_backoff'}
691 0 0 2 not $decapitated and ($neck_pos = index($buf, "$YAHC::CRLF$YAHC::CRLF")) > 0
695 1 1 0 $is_chunked and exists $headers->{'Trailer'}
708 0 1 1 $decapitated and $is_chunked
1 0 0 $conn->{'request'}{'method'} and $conn->{'request'}{'method'} eq 'HEAD'
0 1 0 $decapitated and ($conn->{'request'}{'method'} and $conn->{'request'}{'method'} eq 'HEAD')
0 0 1 $decapitated and length $buf >= $content_length
738 0 0 0 $neck_pos < 0 and $chunk_size == 0
843 0 13 0 not connect($sock, $addr) and $! != 115
855 0 6 11 not $port and $host =~ /^(.+):([0-9]+)$/o
856 0 13 4 not $ip and $host =~ /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/o
904 0 0 0 $host and $port
0 0 0 $host and $port and $scheme
986 24 2 7 defined $request->{'head'} && @{$request->{'head'};}
1024 0 14 0 defined $watchers and my $w = $watchers->{'lifetime_timer'}
1040 0 0 2 $ref eq 'ARRAY' and @$value > 0

or 2 conditions

line l !l condition
108 0 9 delete $args->{'debug'} || $ENV{'YAHC_DEBUG'} || 0
0 9 delete $args->{'keep_timeline'} || $ENV{'YAHC_TIMELINE'} || 0
159 0 10 $request->{'scheme'} ||= 'http'
169 2 8 $request->{'retries'} || 0
222 0 0 $reason || 'no reason'
294 0 0 $request->{'path'} || '/'
346 0 0 $how || 0
349 0 6 $how || 0
476 0 0 $@ || 'zombie error'
504 11 0 POSIX::strerror($err) || ''
561 0 0 $options{$_} || ''
693 1 1 $headers->{'Transfer-Encoding'} || ''
760 1 2 $error ||= 0
761 1 2 $strerror ||= ''
782 0 0 $@ || 'zombie error'
857 13 0 gethostbyname $host || die("Failed to resolve $host\n")
858 17 0 $conn->{'request'}{'scheme'} || 'http'
883 0 0 $conn->{'request'}{'proto'} || ''
0 0 $conn->{'response'}{'proto'} || ''
0 0 $conn->{'response'}{'head'}{'Connection'} || ''
971 4 29 $request->{'path'} || '/'
986 3 30 $request->{'method'} || 'GET'
32 1 $request->{'protocol'} || 'HTTP/1.1'
1089 0 0 $@ || 'zombie error'
1102 0 0 $@ || 'zombie error'
1112 18 4 $conn->{'timeline'} ||= []
1119 11 1 $conn->{'errors'} ||= []
1140 0 0 $ms || 0

or 3 conditions

line l !l&&r !l&&!r condition
136 0 0 0 $request->{$_} ||= $pool_args->{$_}
160 0 0 10 delete $request->{'debug'} || $self->{'debug'}
161 4 0 6 delete $request->{'keep_timeline'} || $self->{'keep_timeline'}
169 0 4 6 $debug || $keep_timeline
281 4 0 0 $host || $ip
294 0 0 0 $host || $ip
356 0 0 2 not $stop_condition or $conn->{'state'} < $stop_condition->{'expected_state'}
430 0 0 0 $watchers->{'retry'} ||= $self->{'loop'}->idle_ns(_get_safe_wrapper($self, $conn, sub { (shift())->stop; _register_in_timeline($conn, 'time for new attempt (iteration=%d)', $self->{'loop'}->iteration) if exists $conn->{'debug_or_timeline'}; _set_init_state($self, $conn_id); } ))
627 0 0 0 $! == 11 or $! == 4
0 0 0 $! == 11 or $! == 4 or $! == 11
679 0 0 0 $! == 11 or $! == 4
0 0 0 $! == 11 or $! == 4 or $! == 11
695 1 1 0 $is_chunked || exists $headers->{'Content-Length'}
791 0 0 0 $state == 35 or $state == 100
799 1 0 0 $state == 35 or $state == 100
857 4 13 0 $ip ||= inet_ntoa(gethostbyname $host || die("Failed to resolve $host\n"))
858 0 17 0 $scheme ||= $conn->{'request'}{'scheme'} || 'http'
859 1 0 5 $conn->{'request'}{'port'} || ($scheme eq 'https' ? 443 : 80)
11 6 0 $port ||= $conn->{'request'}{'port'} || ($scheme eq 'https' ? 443 : 80)
883 11 2 0 $force_close or not defined $socket_cache
13 0 0 $force_close or not defined $socket_cache or ($conn->{'request'}{'proto'} || '') eq 'HTTP/1.0'
2 0 0 $force_close or not defined $socket_cache or ($conn->{'request'}{'proto'} || '') eq 'HTTP/1.0' or ($conn->{'response'}{'proto'} || '') eq 'HTTP/1.0'
0 0 0 $force_close or not defined $socket_cache or ($conn->{'request'}{'proto'} || '') eq 'HTTP/1.0' or ($conn->{'response'}{'proto'} || '') eq 'HTTP/1.0' or ($conn->{'response'}{'head'}{'Connection'} || '') eq 'close'
980 0 0 9 $has_host ||= lc $request->{'head'}[2 * $_] eq 'host'