Branch Coverage

blib/lib/Mojo/URL.pm
Criterion Covered Total %
branch 80 82 97.5


line true false branch
23 2381 2537 if (defined $host_port)
24 1932 449 if $host_port =~ s/:(\d+)$//u
26 17 2364 $host =~ /[^\x00-\x7f]/u ? :
29 1222 1315 unless defined(my $host = $self->ihost)
30 276 1039 unless defined(my $port = $self->port)
38 2 43 /^xn--(.+)$/u ? :
18 5034 if @_
41 1222 3812 unless defined(my $host = $self->host)
42 3780 32 unless $host =~ /[^\x00-\x7f]/u
45 43 39 /[^\x00-\x7f]/u ? :
50 1286 5125 @_ > 1 ? :
57 1392 1415 if defined $2
58 2807 0 if defined $5
59 148 2659 if defined $7
60 38 2769 if defined $9
61 1389 1418 if (defined(my $auth = $4))
62 18 1371 if $auth =~ s/^([^\@]+)\@//u
69 4 2 ((shift())->userinfo // '') =~ /:(.*)$/u ? :
76 6987 3921 unless @_
79 52 3869 ref $_[0] ? :
87 1025 2564 if (defined $pq)
88 0 1025 unless $pq =~ /^([^?#]*)(?:\?([^#]*))?/u
89 127 898 defined $2 ? :
93 224 2340 length $query ? :
103 4094 308 unless @_
106 3 305 if (@_ > 1) { }
11 294 elsif (ref $_[0] eq 'HASH') { }
2 292 elsif (ref $_[0] eq 'ARRAY') { }
115 15 277 ref $_[0] ? :
124 64 261 if $abs->is_abs
131 6 255 if $abs->host
136 203 52 if $path->leading_slash
139 10 42 if (not @{$path->parts;}) { }
143 8 2 unless length $abs->query->to_string
155 5 1 ((shift())->userinfo // '') =~ /^([^:]+)/u ? :
166 364 1216 if (my $proto = $self->protocol)
170 358 1222 if defined $auth
171 3 1577 if ($unsafe and defined(my $info = $self->userinfo))
174 358 1222 if defined $auth
178 1577 3 !($auth && length $path) || $path =~ m[^[/?]]u ? :
181 1518 62 unless defined(my $fragment = $self->fragment)