Branch Coverage

blib/lib/URI.pm
Criterion Covered Total %
branch 79 94 84.0


line true false branch
9 1 39 $ENV{'URI_HAS_RESERVED_SQUARE_BRACKETS'} ? :
58 1213 0 defined $uri ? :
66 922 291 if ($uri =~ /^($scheme_re):/so) { }
70 11 280 if ($impclass = ref $scheme) { }
136 288 elsif ($scheme and $scheme =~ /^($scheme_re)(?::|$)/o) { }
101 0 1211 unless $str =~ /^$scheme_re:/o or $class->_no_scheme_ok
116 1132 73 unless $_[0] =~ /%/
117 4 69 if $_[0] =~ /^(?:$schemes_without_host_part_re):/so
120 10 59 if ($_[0] =~ /^(?:$fallback_schemes_re):/so)
126 44 15 if ($_[0] =~ m[^((?:$scheme_re:)?)//([^/?\#]+)(.*)$]so)
130 5 39 $host =~ s/(:\d+)$// ? :
153 144 1058 unless ($scheme and $scheme =~ /\A$scheme_re\z/o)
160 0 1058 if ($impclass)
169 953 105 if $ic
182 101 4 unless (@{"${ic}::ISA";})
183 101 0 unless (exists $require_attempted{$ic})
187 0 101 if $@ and not $@ =~ /Can\'t locate.*in \@INC/
190 45 56 unless @{"${ic}::ISA";}
222 1219 333 unless (@_)
223 316 903 unless $$self =~ /^($scheme_re):/o
229 269 64 if (defined $new and length $new) { }
230 0 269 unless $new =~ /^$scheme_re$/o
231 22 247 if $$self =~ s/^($scheme_re)://o
237 64 0 if ($self->_no_scheme_ok) { }
238 64 0 if $$self =~ s/^($scheme_re)://o
239 0 64 if $^W and $$self =~ /^$scheme_re:/o
243 0 0 if $$self =~ /^($scheme_re):/o
253 500 584 unless defined $scheme
266 57 27 unless (@_)
267 0 57 unless $$self =~ /^(?:$scheme_re:)?([^\#]*)/o
271 0 27 unless $$self =~ /^($scheme_re:)? # optional scheme ([^\#]*) # opaque (\#.*)? # optional fragment $/sx
281 1 26 unless defined $new_opaque
285 26 1 defined $old_scheme ? :
287 5 22 if defined $old_frag
298 51 20 unless (@_)
299 27 24 unless $$self =~ /\#(.*)/s
304 5 15 if $$self =~ s/\#(.*)//s
307 18 2 if (defined $new_frag)
327 10 5 if ($str =~ s/%([89a-fA-F][0-9a-fA-F])/chr hex $1;/eg)
340 3 10 if (length $str)
360 405 52 unless $uc_scheme or $esc
363 10 42 if ($uc_scheme)
366 42 10 if ($esc)
368 41 148 $a =~ /^[$unreserved]\z/o ? :
377 0 15 unless ref $self
378 8 7 unless ref $other
379 15 0 if ref $self eq ref $other