Branch Coverage

blib/lib/Mojo/Util.pm
Criterion Covered Total %
branch 126 132 95.4


line true false branch
93 3 39 if $str =~ /^[A-Z]/u
112 5 23 unless $str =~ /^[A-Z]/u
122 85 7247 unless eval { do { $bytes = _encoding($encoding)->decode("$bytes", 1); 1 } }
128 1 1 $ENV{'MOJO_FATAL_DEPRECATIONS'} ? :
136 25 1 @_ ? :
147 187 45 ref $_[0] eq 'ARRAY' ? :
158 0 2 unless IO::Uncompress::Gunzip::gunzip(\$compressed, \my $uncompressed)
165 0 54 unless IO::Compress::Gzip::gzip(\$uncompressed, \my $compressed)
177 4 16 if ($value =~ /$QUOTED_VALUE_RE/cgou) { }
15 1 elsif ($value =~ /$UNQUOTED_VALUE_RE/cgou) { }
192 6 13 $size < 0 ? :
194 3 16 if ($size = abs $size) < 1024
195 5 11 if ($size /= 1024) < 1024
196 3 8 if ($size /= 1024) < 1024
197 6 2 if ($size /= 1024) < 1024
210 6 93 unless length $cidr and length $addr
215 2 91 if $v6 xor $addr =~ /:/u
218 36 55 $v6 ? :
2 89 unless $net = inet_pton($v6 ? 10 : 2, $net)
219 35 54 $v6 ? :
2 87 unless $addr = inet_pton($v6 ? 10 : 2, $addr)
220 34 53 $v6 ? :
223 73 14 if defined $mask
237 12 11 if $input =~ s/(.*)\x2d//su
245 140 318 $digit < 64 ? :
248 274 98 $t > 26 ? :
86 372 $t < 1 ? :
249 219 239 if $digit < $t
273 41 23 if $basic > 0
276 42 218 if $m < $n
282 2033 1597 if ($c < $n) { }
260 1337 elsif ($c == $n) { }
289 315 98 $t > 26 ? :
168 413 $t < 1 ? :
290 260 321 if $q < $t
292 169 152 $o < 26 ? :
296 260 0 $q < 26 ? :
321 23 63 if $r
329 6 8 if ($allow_unicode) { }
355 83 93 if $len >= ($spec[$i] // 0)
378 57 369 unless length $1
379 36 1 if $min
385 0 48 unless $str =~ s/^"(.*)"$/$1/gu
394 5799 15 if ($pattern) { }
395 133 5666 unless (exists $PATTERN{$pattern})
397 0 133 unless $PATTERN{$pattern} = eval "sub { \$_[0] =~ s/([$quoted])/sprintf '%%%02X', ord \$1/ge }"
413 1 485 if ref $_[0] and ref $_[0] eq "Mojo::ByteStream"
1793 6187 if ref $_[0] and ref $_[0] eq "Mojo::ByteStream"
433 85 394 $firsttime ? :
450 32 9 !($point =~ /^x/u) ? :
41 950 unless defined $name
456 10 4 if exists $ENTITIES{$name} and !$attr || $name =~ /;$/u || !($last =~ /[A-Za-z0-9=]/u)
471 120 678 if ($expires and $str =~ /\G=\s*$EXPIRES_RE/cgou) { }
42 636 elsif ($str =~ /$QUOTED_VALUE_RE/cgou) { }
538 98 elsif ($str =~ /$UNQUOTED_VALUE_RE/cgou) { }
480 691 107 unless $str =~ /\G[;\s]*,\s*/cgu
486 186 1015 @part ? :
498 996 456 ref $_[0] eq 'HASH' ? :
1452 349 if @_ == 1
501 80 269 if @_ % 2
504 18 251 ref $_[1] eq 'HASH' ? :
510 12 4 $_[0] < 10 ? :
516 19607 1316 unless @_
519 230 1086 unless @_ > 1 or ref $_[0]
522 22 1064 ref $_[0] ? :
529 0 826 unless my $class = shift()