Branch Coverage

blib/lib/Mojo/UserAgent/Transactor.pm
Criterion Covered Total %
branch 104 110 94.5


line true false branch
21 1 0 if $_[0]->generators->{$_[1]} = $_[2]
31 24 44 $proto eq 'https' ? :
35 64 1984 if (my $proxy = $req->proxy)
36 1867 150 if $proto eq "http" and not $req->is_handshake and not $socks
46 4 43 if $err and not $err->{'code'}
47 2 41 if $tx->req->is_handshake and not $tx->is_websocket
56 4 187 if uc $req->method eq "CONNECT"
59 180 7 unless my $proxy = $req->proxy and $req->via_proxy
60 2 5 if $proxy->protocol eq "socks"
64 2 3 unless $req->is_handshake or $url->protocol eq "https"
80 863 54 unless grep {$_ == $code;} 301, 302, 303, 307, 308
84 1 53 if uc $req->method eq "CONNECT"
87 0 53 unless my $location = $res->headers->every_header("Location")->[0]
89 17 36 unless $location->is_abs
91 2 51 if $proto ne "http" and $proto ne "https" or not $location->host
95 10 41 if ($code == 307 or $code == 308) { }
96 2 8 unless my $clone = $req->clone
101 12 29 $code == 303 || $method eq 'POST' ? :
106 1 48 unless $self->compressed
119 1002 6 $url =~ m[^/|://]u ? :
34 1008 ref $url ? :
123 190 852 if ref $_[0] eq "HASH"
124 1039 3 unless $headers->user_agent
125 3 1039 if (not $self->compressed) { }
1039 0 elsif (not $headers->accept_encoding) { }
129 83 959 if (@_ > 1) { }
25 934 elsif (@_) { }
143 893 63 unless $tx->req->is_handshake and $code == 101
145 63 0 challenge($ws) ? :
152 8 72 ref $_[-1] eq 'ARRAY' ? :
155 8 72 if @$sub
160 7 73 if ($proto eq 'ws') { }
5 68 elsif ($proto eq 'wss') { }
1 67 elsif ($proto eq 'ws+unix') { }
171 60 6 unless exists $options{'charset'}
177 10 94 ref $_ eq 'ARRAY' ? :
178 21 87 if ref $value eq "HASH"
182 27 39 if ($multipart)
191 7 32 if ($method eq 'GET' or $method eq 'HEAD') { }
205 1 40 unless defined(my $values = $form->{$name})
206 35 5 unless ref $values eq "ARRAY"
235 30 25 if (ref $value eq 'HASH') { }
238 9 21 if (my $file = delete $value->{'file'}) { }
21 0 elsif (defined(my $content = delete $value->{'content'})) { }
239 5 4 unless ref $file
241 7 2 if $file->isa("Mojo::Asset::File")
252 4 26 unless defined $name
254 26 0 if $charset
259 22 3 if $charset
264 3 48 if not defined $name or defined $headers->content_disposition
266 47 1 if $charset
268 25 23 if defined $filename
279 51 2030 if ($req->via_proxy and my $proxy = $req->proxy)
280 3 9 $proto eq 'https' ? :
286 61 9 unless $_[0]->content_type