Branch Coverage

lib/HTTP/Promise/Response.pm
Criterion Covered Total %
branch 70 86 81.4


line true false branch
33 5 3 if (@_)
35 0 5 if (@_ == 1 and ref $_[0] eq 'HASH') { }
5 0 elsif (@_ >= 2 and defined $_[0] and $_[0] =~ /^\d{3}$/ and defined $_[1] && $_[1] =~ /\S/ || !defined($_[1])) { }
49 0 0 defined $_ ? :
63 0 8 unless $self->SUPER::init(@_)
75 0 4 unless $self->_load_class("URI", {"version", "5.1"})
76 0 4 if ($base and $base =~ /^[a-zA-Z][a-zA-Z0-9.+\-]*:/)
83 4 0 if ($req)
105 1 1 if defined $req
120 10 3 if $h_client_date
121 9 4 if $h_date
124 9 4 if ($response_time and $date)
128 3 6 if $age < 0
132 4 9 if ($age_v and $age_v > $age)
138 10 3 if ($response_time)
141 8 2 if ($request)
144 7 1 if $req_date
145 6 2 if ($request_time and $request_time < $response_time)
163 1 0 if $proto
175 7 3 if ($dispo)
178 0 7 unless defined $cd
182 5 5 unless (defined $file and length $file)
184 0 5 unless $self->_load_class("URI", {"version", "5.1"})
186 1 4 if (my $cl = $self->header('Content-Location')) { }
3 1 elsif (my $request = $self->request) { }
195 2 3 if ($uri)
202 7 3 if ($file)
208 0 10 if ($file and not length $file)
222 1 4 unless defined $f
234 0 6 unless defined $cc and length "$cc"
237 3 3 if $cc_dir =~ /^max-age[[:blank:]\h]*=[[:blank:]\h]*(\d+)/i
247 1 20 if (my $expires = $self->expires)
253 4 16 if exists $opts->{'heuristic_expiry'} and not $opts->{'heuristic_expiry'}
265 12 4 if (my $last_modified = $self->last_modified)
268 2 10 if $h_exp < $opts->{'h_min'}
269 8 2 if $h_exp > $opts->{'h_max'}
274 1 3 if $opts->{'h_min'} > $opts->{'h_default'}
288 1 2 unless defined $f
304 2 1 unless defined $str
306 2 1 unless (defined $str and length $str)
308 0 2 ref $self ? :
311 0 1 unless $self->_load_class("HTTP::Promise::Parser")
339 4 0 unless defined $eol