Condition Coverage

blib/lib/YAHC.pm
Criterion Covered Total %
condition 76 204 37.2


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 7 4 0 defined $args and ref $args ne 'HASH'
197 3 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 1 $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 4 10 0 $attempt > 1 and exists $conn->{'request'}{'_backoff'}
698 0 0 7 not $decapitated and ($neck_pos = index($buf, "$YAHC::CRLF$YAHC::CRLF")) > 0
702 6 1 0 $is_chunked and exists $headers->{'trailer'}
727 0 5 1 $decapitated and $is_chunked
0 2 3 $decapitated and not $no_content_length
2 0 3 $decapitated and not $no_content_length and length $buf >= $content_length
757 0 0 0 $neck_pos < 0 and $chunk_size == 0
860 0 14 0 not connect($sock, $addr) and $! != 115
872 0 6 12 not $port and $host =~ /^(.+):([0-9]+)$/o
873 0 14 4 not $ip and $host =~ /^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$/o
921 0 0 0 $host and $port
0 0 0 $host and $port and $scheme
1003 24 2 7 defined $request->{'head'} && @{$request->{'head'};}
1041 0 16 0 defined $watchers and my $w = $watchers->{'lifetime_timer'}
1057 0 0 3 $ref eq 'ARRAY' and @$value > 0

or 2 conditions

line l !l condition
108 0 11 delete $args->{'debug'} || $ENV{'YAHC_DEBUG'} || 0
0 11 delete $args->{'keep_timeline'} || $ENV{'YAHC_TIMELINE'} || 0
159 0 16 $request->{'scheme'} ||= 'http'
169 2 14 $request->{'retries'} || 0
222 0 0 $reason || 'no reason'
294 0 0 $request->{'path'} || '/'
346 0 0 $how || 0
349 0 11 $how || 0
476 0 0 $@ || 'zombie error'
504 12 0 POSIX::strerror($err) || ''
561 0 0 $options{$_} || ''
700 1 6 $headers->{'transfer-encoding'} || ''
711 0 7 $conn->{'request'}{'method'} || ''
777 3 6 $error ||= 0
778 3 6 $strerror ||= ''
799 0 0 $@ || 'zombie error'
874 14 0 gethostbyname $host || die("Failed to resolve $host\n")
875 18 0 $conn->{'request'}{'scheme'} || 'http'
900 0 0 $conn->{'request'}{'proto'} || ''
0 0 $conn->{'response'}{'proto'} || ''
0 0 $conn->{'response'}{'head'}{'connection'} || ''
988 4 29 $request->{'path'} || '/'
1003 3 30 $request->{'method'} || 'GET'
32 1 $request->{'protocol'} || 'HTTP/1.1'
1106 0 0 $@ || 'zombie error'
1119 0 0 $@ || 'zombie error'
1129 39 9 $conn->{'timeline'} ||= []
1136 12 3 $conn->{'errors'} ||= []
1157 0 0 $ms || 0

or 3 conditions

line l !l&&r !l&&!r condition
108 1 10 0 delete $args->{'loop'} || 'EV::Loop'->new
136 0 0 0 $request->{$_} ||= $pool_args->{$_}
160 0 0 16 delete $request->{'debug'} || $self->{'debug'}
161 9 0 7 delete $request->{'keep_timeline'} || $self->{'keep_timeline'}
169 0 9 7 $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
680 0 0 0 $! == 11 or $! == 4
0 0 0 $! == 11 or $! == 4 or $! == 11
711 0 0 7 ($conn->{'request'}{'method'} || '') eq 'HEAD' or $conn->{'response'}{'status'} =~ /^(1..|204|304)$/
808 0 0 0 $state == 35 or $state == 100
816 2 0 0 $state == 35 or $state == 100
874 4 14 0 $ip ||= inet_ntoa(gethostbyname $host || die("Failed to resolve $host\n"))
875 0 18 0 $scheme ||= $conn->{'request'}{'scheme'} || 'http'
876 1 5 0 $conn->{'request'}{'port'} || ($scheme eq 'https' ? 443 : 80)
12 6 0 $port ||= $conn->{'request'}{'port'} || ($scheme eq 'https' ? 443 : 80)
900 13 6 0 $force_close or not defined $socket_cache
19 0 0 $force_close or not defined $socket_cache or ($conn->{'request'}{'proto'} || '') eq 'HTTP/1.0'
6 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'
997 0 0 9 $has_host ||= lc $request->{'head'}[2 * $_] eq 'host'