Branch Coverage

blib/lib/HTTP/CookieJar.pm
Criterion Covered Total %
branch 91 110 82.7


line true false branch
45 0 44 unless defined $cookie and length $cookie
47 0 44 if $@
49 1 43 unless my $parse = _parse_cookie($cookie)
53 16 27 if (exists $parse->{'domain'}) { }
54 4 12 unless _normalize_domain($host, $parse)
63 22 17 if (not exists $parse->{'path'} or substr($parse->{'path'}, 0, 1) ne "/")
69 6 33 if (exists $parse->{'max-age'})
74 3 3 $parse->{'max-age'} <= 0 ? :
78 4 35 if (my $old = $self->{'store'}{$domain}{$path}{$name})
82 4 35 if (defined $parse->{'expires'} and $parse->{'expires'} < $now) { }
150 0 12 if $@
155 1 22 if $cookie->{'hostonly'} and $host ne $cookie->{'domain'}
156 1 21 if $cookie->{'secure'} and $scheme ne "https"
157 0 21 if defined $cookie->{'expires'} and $cookie->{'expires'} < $now
158 0 21 unless _domain_match($host, $cookie->{'domain'})
159 1 20 unless _path_match($request_path, $cookie->{'path'})
166 0 13 unless length $HTTP::CookieJar::b->{'path'} <=> length $HTTP::CookieJar::a->{'path'}
215 4 4 if (defined $c->{'expires'}) { }
219 1 3 if $args->{'persistent'}
222 28 0 if defined $$c{lc $attr}
225 16 5 if $$c{lc $attr}
256 1 4 unless exists $p->{'domain'} and exists $p->{'path'}
281 0 62 unless defined $cookie
283 2 60 unless defined $kvp
287 4 58 unless defined $name and length $name
288 0 58 unless defined $value
291 3 94 unless defined $s and $s =~ /\S/
294 29 65 $private ? :
0 94 unless $private ? $k =~ /^$pvt_re$/ : $k =~ /^$pub_re$/
295 22 72 if $k =~ /^(?:httponly|secure|hostonly)$/
296 10 84 if $k eq "expires"
297 1 93 unless length $v
298 22 71 if $k eq "domain"
299 25 68 if $k eq "path"
307 19 27 if $dom_string eq $string
308 3 24 unless $string =~ /[a-z]/i
309 13 11 if ($string =~ s/\Q$dom_string\E$//)
318 16 0 if ($HAS_MPS)
320 3 13 unless defined $host_pub_suff
321 4 12 if (_domain_match($host_pub_suff, $parse->{'domain'}))
322 2 2 if ($parse->{'domain'} eq $host) { }
331 3 9 if (not $parse->{'domain'} =~ /\./ and $parse->{'domain'} eq $host)
340 0 22 if not length $path or substr($path, 0, 1) ne "/"
342 7 15 length $default ? :
347 3 18 if $req_path eq $cookie_path
348 17 1 if ($req_path =~ /^\Q$cookie_path\E(.*)/)
350 6 11 if substr($cookie_path, -1, 1) eq "/"
351 11 0 if substr($rest, 0, 1) eq "/"
358 0 56 unless defined $url and length $url
362 0 56 unless my($scheme, $authority, $path_query) = $url =~ m[\A([^:/?#]+)://([^/?#]*)([^#?]*)]
366 0 56 unless $path_query =~ m[\A/]
369 56 0 length $authority ? :
372 1 0 $scheme eq 'https' ? :
55 1 $scheme eq 'http' ? :
0 56 $host =~ s/:([0-9]*)\z// && length $1 ? :