Branch Coverage

blib/lib/Net/Async/HTTP.pm
Criterion Covered Total %
branch 148 180 82.2


line true false branch
366 53 1039 if exists $params{$_}
370 1 51 if (my $headers = delete $params{'headers'})
371 1 0 ref $headers eq 'HASH' ? :
0 1 ref $headers eq 'ARRAY' ? :
377 1 51 if (my $more = delete $params{'+headers'})
378 1 0 ref $more eq 'HASH' ? :
0 1 ref $more eq 'ARRAY' ? :
396 0 52 if (exists $params{'ip_tos'})
399 0 0 if defined $ip_tos and $ip_tos eq "lowdelay"
400 0 0 if defined $ip_tos and $ip_tos eq "throughput"
401 0 0 if defined $ip_tos and $ip_tos eq "reliability"
402 0 0 if defined $ip_tos and $ip_tos eq "mincost"
408 10 42 unless defined $self->{'user_agent'}
409 38 14 unless defined $self->{'max_redirects'}
410 37 15 unless defined $self->{'max_in_flight'}
411 33 19 unless defined $self->{'pipeline'}
433 1 102 defined $args{'path'} ? :
437 0 103 if (my $socks_params = $self->{'socks_params'})
445 2 101 if ($args{'SSL'})
452 102 1 if (exists $args{'port'})
456 1 102 unless (exists $args{'host'})
462 0 412 defined $self->{$_} ? :
472 0 95 if defined $self->{'ip_tos'}
479 20 83 unless $f->is_ready
489 0 146 unless my $loop = $self->get_loop
491 1 145 defined $args{'path'} ? :
497 14 39 if $conn->is_idle and $conn->read_handle
501 128 4 unless $ready
507 29 103 if ($max and @$conns >= $max)
526 2 67 if (my $next = &first(sub { not $_->connecting; } , @$ready_queue))
541 7 0 unless $f->is_cancelled
547 2 5 if (my $next = &first(sub { not $_->connecting; } , @$ready_queue))
793 2 142 if ($self->{'require_SSL'} and not $SSL)
798 36 106 if ($Net::Async::HTTP::metrics)
806 1 141 if (defined $args{'proxy_host'} or defined $self->{'proxy_host'} and not defined $args{'proxy_path'}) { }
1 140 elsif (defined $args{'proxy_path'} or defined $self->{'proxy_path'}) { }
834 2 5 /^SSL_/u ? :
838 1 133 $args{'on_ready'} ? :
851 1 119 if ($Net::Async::HTTP::metrics)
859 4 130 $SSL ? :
860 1 141 defined $args{'family'} ? :
4 138 $SSL ? :
868 109 11 unless $response->is_redirect and defined $response->header("Location")
886 1 134 defined $args{'max_redirects'} ? :
896 9 135 if ($previous_f)
902 6 3 if ($location =~ m[^http(?:s?)://]u) { }
3 0 elsif ($location =~ m[^/]u) { }
906 0 3 $port != 80 ? :
914 0 9 unless ($loc_uri)
920 2 7 if $args{'on_redirect'}
929 103 41 if (defined $uri->scheme and $uri->scheme =~ /^http(s?)$/u)
930 12 91 unless defined $host
931 16 87 unless defined $port
935 0 144 unless defined $host
936 0 40 $ssl ? :
40 104 unless defined $port
949 0 11 if @_
951 11 111 if $redirects and $response->is_redirect
959 17 120 if $f->failure or $f->is_cancelled
963 3 132 if ($self->{'fail_on_error'})
968 2 1 if ($code =~ /^[45]/u)
987 87 48 if (my $uri = delete $args{'uri'}) { }
0 48 elsif (not defined $args{'request'}) { }
994 5 130 if ($args{'on_header'}) { }
130 0 elsif ($args{'on_response'} or defined wantarray) { }
1001 78 104 if (@_) { }
1015 34 101 defined $args{'timeout'} ? :
1019 34 101 if (defined $timeout)
1036 89 46 if $on_error
1038 79 56 if (my $on_response = delete $args{'on_response'})
1050 83 52 if defined wantarray
1060 17 79 if (not ref $uri) { }
0 79 elsif (builtin::blessed($uri) and not $uri->isa('URI')) { }
1074 2 94 if ($method eq 'POST') { }
1075 0 2 unless defined $args{'content'}
1079 0 2 unless ref $args{'content'} or defined $args{'content_type'}
1086 3 91 if (defined $args{'content'})
1087 0 3 unless defined $args{'content_type'}
1095 22 74 if ($args{'port'} != $uri->default_port) { }
1103 1 95 if ($headers and builtin::reftype($headers) eq 'ARRAY') { }
1 188 elsif ($headers and builtin::reftype($headers) eq 'HASH') { }
1112 1 95 if (defined $uri->userinfo) { }
1 188 elsif (defined $args{'user'} and defined $args{'pass'}) { }
1120 2 94 if (defined $user and defined $pass)
1221 34 110 if length $self->{'user_agent'}
1222 1 143 if ($self->{'close_after_request'}) { }
1233 2 142 if $self->{'cookie_jar'}
1250 2 107 if $self->{'cookie_jar'}
1359 2 0 if (@_) { }
1362 0 2 unless my $d = $DECODERS{$name}