Branch Coverage

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


line true false branch
45 0 41 unless defined $cookie and length $cookie
47 0 41 if $@
49 1 40 unless my $parse = _parse_cookie($cookie)
53 16 24 if (exists $parse->{'domain'}) { }
54 4 12 unless _normalize_domain($host, $parse)
63 22 14 if (not exists $parse->{'path'} or substr($parse->{'path'}, 0, 1) ne '/')
69 6 30 if (exists $parse->{'max-age'})
74 3 3 $parse->{'max-age'} <= 0 ? :
78 4 32 if (my $old = $self->{'store'}{$domain}{$path}{$name})
82 4 32 if (defined $parse->{'expires'} and $parse->{'expires'} < $now) { }
143 0 9 if $@
148 1 13 if $cookie->{'hostonly'} and $host ne $cookie->{'domain'}
149 1 12 if $cookie->{'secure'} and $scheme ne 'https'
150 0 12 if defined $cookie->{'expires'} and $cookie->{'expires'} < $now
151 0 12 unless _domain_match($host, $cookie->{'domain'})
152 1 11 unless _path_match($request_path, $cookie->{'path'})
158 0 3 unless length $HTTP::CookieJar::b->{'path'} <=> length $HTTP::CookieJar::a->{'path'}
207 4 4 if (defined $c->{'expires'}) { }
211 1 3 if $args->{'persistent'}
214 28 0 if defined $$c{lc $attr}
217 16 5 if $$c{lc $attr}
248 1 4 unless exists $p->{'domain'} and exists $p->{'path'}
275 0 59 unless defined $cookie
277 2 57 unless defined $kvp
281 4 55 unless defined $name and length $name
282 0 55 unless defined $value
285 3 91 unless defined $s and $s =~ /\S/
288 29 62 $private ? :
0 91 unless $private ? $k =~ /^$pvt_re$/ : $k =~ /^$pub_re$/
289 22 69 if $k =~ /^(?:httponly|secure|hostonly)$/
290 10 81 if $k eq 'expires'
291 1 90 unless length $v
292 22 68 if $k eq 'domain'
293 22 68 if $k eq 'path'
301 10 27 if $dom_string eq $string
302 3 24 unless $string =~ /[a-z]/i
303 13 11 if ($string =~ s/\Q$dom_string\E$//)
312 16 0 if ($HAS_MPS)
314 3 13 unless defined $host_pub_suff
315 4 12 if (_domain_match($host_pub_suff, $parse->{'domain'}))
316 2 2 if ($parse->{'domain'} eq $host) { }
325 3 9 if (not $parse->{'domain'} =~ /\./ and $parse->{'domain'} eq $host)
334 0 22 if not length $path or substr($path, 0, 1) ne '/'
336 7 15 length $default ? :
341 3 9 if $req_path eq $cookie_path
342 8 1 if ($req_path =~ /^\Q$cookie_path\E(.*)/)
344 3 5 if substr($cookie_path, -1, 1) eq '/'
345 5 0 if substr($rest, 0, 1) eq '/'
352 0 50 unless defined $url and length $url
356 0 50 unless my($scheme, $authority, $path_query) = $url =~ m[\A([^:/?#]+)://([^/?#]*)([^#?]*)]
360 0 50 unless $path_query =~ m[\A/]
363 50 0 length $authority ? :
366 1 0 $scheme eq 'https' ? :
49 1 $scheme eq 'http' ? :
0 50 $host =~ s/:([0-9]*)\z// && length $1 ? :