Branch Coverage

blib/lib/URI.pm
Criterion Covered Total %
branch 80 94 85.1


line true false branch
9 1 57 $ENV{'URI_HAS_RESERVED_SQUARE_BRACKETS'} ? :
58 1248 0 defined $uri ? :
66 957 291 if ($uri =~ /^($scheme_re):/so) { }
70 11 280 if ($impclass = ref $scheme) { }
136 288 elsif ($scheme and $scheme =~ /^($scheme_re)(?::|$)/o) { }
101 0 1246 unless $str =~ /^$scheme_re:/o or $class->_no_scheme_ok
116 1163 77 unless $_[0] =~ /%/
117 4 73 if $_[0] =~ /^(?:$schemes_without_host_part_re):/so
120 10 63 if ($_[0] =~ /^(?:$fallback_schemes_re):/so)
126 48 15 if ($_[0] =~ m[^((?:$scheme_re:)?)//([^/?\#]+)(.*)$]so)
130 5 43 $host =~ s/(:\d+)$// ? :
153 144 1093 unless ($scheme and $scheme =~ /\A$scheme_re\z/o)
160 0 1093 if ($impclass)
169 971 122 if $ic
182 117 5 unless (@{"${ic}::ISA";})
183 81 36 unless (exists $require_attempted{$ic})
189 0 81 if $@ and not $@ =~ /Can\'t locate.*in \@INC/
192 45 72 unless @{"${ic}::ISA";}
224 1246 335 unless (@_)
225 316 930 unless $$self =~ /^($scheme_re):/o
231 271 64 if (defined $new and length $new) { }
232 0 271 unless $new =~ /^$scheme_re$/o
233 24 247 if $$self =~ s/^($scheme_re)://o
239 64 0 if ($self->_no_scheme_ok) { }
240 64 0 if $$self =~ s/^($scheme_re)://o
241 0 64 if $^W and $$self =~ /^$scheme_re:/o
245 0 0 if $$self =~ /^($scheme_re):/o
255 500 606 unless defined $scheme
268 61 27 unless (@_)
269 0 61 unless $$self =~ /^(?:$scheme_re:)?([^\#]*)/o
273 0 27 unless $$self =~ /^($scheme_re:)? # optional scheme ([^\#]*) # opaque (\#.*)? # optional fragment $/sx
283 1 26 unless defined $new_opaque
287 26 1 defined $old_scheme ? :
289 5 22 if defined $old_frag
300 57 20 unless (@_)
301 33 24 unless $$self =~ /\#(.*)/s
306 5 15 if $$self =~ s/\#(.*)//s
309 18 2 if (defined $new_frag)
329 10 5 if ($str =~ s/%([89a-fA-F][0-9a-fA-F])/chr hex $1;/eg)
342 3 10 if (length $str)
362 410 54 unless $uc_scheme or $esc
365 10 44 if ($uc_scheme)
368 44 10 if ($esc)
371 115 148 $a =~ /^[$unreserved]\z/o ? :
380 0 17 unless ref $self
381 8 9 unless ref $other
382 17 0 if ref $self eq ref $other