Branch Coverage

blib/lib/URI/_generic.pm
Criterion Covered Total %
branch 89 106 83.9


line true false branch
23 20 295 unless ($IPv6_re)
28 20 0 unless (eval { do { require Regexp::IPv6; "Regexp::IPv6"->import("\$IPv6_re"); 1 } })
31 0 315 unless $addr
32 289 26 if $addr =~ tr/:// < 2
33 2 24 if $addr =~ /^$IPv6_re$/i
41 0 2336 unless $$self =~ m[^((?:$URI::scheme_re:)?)(?://([^/?\#]*))?(.*)$]so
43 414 1922 if (@_)
47 339 75 if (defined $auth)
49 315 24 if (my($user, $host) = $auth =~ /^(.*@)?([^\@]+)$/)
53 2 313 if _looks_like_raw_ip6_address($host)
68 0 1319 unless $$self =~ m[^((?:[^:/?\#]+:)?(?://[^/?\#]*)?)([^?\#]*)(.*)$]s
70 301 1018 if (@_)
74 2 299 unless defined $new_path
86 0 58 unless $$self =~ m[^((?:[^:/?\#]+:)?(?://[^/?\#]*)?)([^\#]*)(.*)$]s
88 3 55 if (@_)
92 0 3 unless defined $new_path
105 566 152 if ($pre =~ m[/]) { }
106 211 355 if length $path and not $path =~ m[^[/?\#]]
109 0 152 if ($path =~ m[^//]) { }
0 175 elsif (not length $pre and $path =~ m[^[^:/?\#]+:]) { }
110 0 0 if $^W
114 0 0 if $^W
119 211 507 if defined $prefix
126 6 84 if (@_)
129 1 20 if (ref $_) { }
142 9 81 unless wantarray
143 4 190 /;/ ? :
162 29 245 if (my $scheme = $self->scheme)
163 19 10 unless $URI::ABS_ALLOW_RELATIVE_SCHEME
164 10 0 unless ref $base
165 3 7 unless $scheme eq $base->scheme
168 105 147 unless ref $base
171 11 241 if $$self =~ m[^(?:$URI::scheme_re:)?//]o
175 19 222 if $path =~ m[^/]
177 26 196 unless (length $path)
180 9 17 if defined $query
182 14 12 if defined $fragment
190 193 3 if @p and not length $p[0]
194 32 584 if ($p[$i - 1] eq '.') { }
107 477 elsif ($p[$i] eq '..' and $p[$i - 1] ne '..') { }
196 32 0 if $i > 1
200 77 30 if ($i > 1)
202 4 73 if $i == @p
209 8 188 if @p and $p[-1] eq "."
210 3 193 if ($URI::ABS_REMOTE_LEADING_DOTS)
222 67 0 unless ref $base
229 0 0 unless (defined $scheme or defined $auth)
240 17 184 unless defined $_
243 5 62 unless ($scheme eq $bscheme and $auth eq $bauth)
248 2 122 unless m[^/]
259 14 75 if $i < 0 or $i != index($bpath, "/", $li) or substr($path, $li, $i - $li) ne substr($bpath, $li, $i - $li)
268 1 61 if ($path eq $bpath and defined $rel->fragment and not defined $rel->query) { }
276 6 55 if $path eq ""