Branch Coverage

blib/lib/Mojo/Util.pm
Criterion Covered Total %
branch 127 136 93.3


line true false branch
25 0 98 $ENV{'MOJO_NO_CRYPTX'} ? :
104 3 39 if $str =~ /^[A-Z]/u
121 5 23 unless $str =~ /^[A-Z]/u
133 0 0 unless $value =~ /^([^-]+)-([^-]+)-([^-]+)$/u
143 87 7735 unless eval { do { $bytes = _encoding($encoding)->decode("$bytes", 1); 1 } }
149 1 1 $ENV{'MOJO_FATAL_DEPRECATIONS'} ? :
168 25 1 @_ ? :
185 195 45 if (ref $_[0] eq 'ARRAY') { }
196 0 2 unless IO::Uncompress::Gunzip::gunzip(\$compressed, \my $uncompressed)
203 0 59 unless IO::Compress::Gzip::gzip(\$uncompressed, \my $compressed)
215 4 16 if ($value =~ /$QUOTED_VALUE_RE/cgou) { }
15 1 elsif ($value =~ /$UNQUOTED_VALUE_RE/cgou) { }
230 6 13 $size < 0 ? :
232 3 16 if ($size = abs $size) < 1024
233 5 11 if ($size /= 1024) < 1024
234 3 8 if ($size /= 1024) < 1024
235 6 2 if ($size /= 1024) < 1024
241 6 93 unless length $cidr and length $addr
246 2 91 if $v6 xor $addr =~ /:/u
249 36 55 $v6 ? :
2 89 unless $net = inet_pton($v6 ? 10 : 2, $net)
250 35 54 $v6 ? :
2 87 unless $addr = inet_pton($v6 ? 10 : 2, $addr)
251 34 53 $v6 ? :
254 73 14 if defined $mask
268 12 11 if $input =~ s/(.*)\x2d//su
276 140 318 $digit < 64 ? :
279 274 98 $t > 26 ? :
86 372 $t < 1 ? :
280 219 239 if $digit < $t
304 41 23 if $basic > 0
307 42 218 if $m < $n
313 2033 1597 if ($c < $n) { }
260 1337 elsif ($c == $n) { }
320 315 98 $t > 26 ? :
168 413 $t < 1 ? :
321 260 321 if $q < $t
323 169 152 $o < 26 ? :
327 260 0 $q < 26 ? :
352 23 74 if $r
360 6 8 if ($allow_unicode) { }
386 83 93 if $len >= ($spec[$i] // 0)
409 57 369 unless length $1
410 36 1 if $min
416 0 48 unless $str =~ s/^"(.*)"$/$1/gu
425 6287 15 if ($pattern) { }
426 142 6145 unless (exists $PATTERN{$pattern})
428 0 142 unless $PATTERN{$pattern} = eval "sub { \$_[0] =~ s/([$quoted])/sprintf '%%%02X', ord \$1/ge }"
444 1 485 if ref $_[0] and ref $_[0] eq "Mojo::ByteStream"
2009 6705 if ref $_[0] and ref $_[0] eq "Mojo::ByteStream"
464 85 394 $firsttime ? :
481 32 9 !($point =~ /^x/u) ? :
41 962 unless defined $name
487 10 4 if exists $ENTITIES{$name} and !$attr || $name =~ /;$/u || !($last =~ /[A-Za-z0-9=]/u)
502 125 708 if ($expires and $str =~ /\G=\s*$EXPIRES_RE/cgou) { }
42 666 elsif ($str =~ /$QUOTED_VALUE_RE/cgou) { }
563 103 elsif ($str =~ /$UNQUOTED_VALUE_RE/cgou) { }
511 726 107 unless $str =~ /\G[;\s]*,\s*/cgu
517 201 1096 @part ? :
529 1012 456 ref $_[0] eq 'HASH' ? :
1468 349 if @_ == 1
532 80 269 if @_ % 2
535 18 251 ref $_[1] eq 'HASH' ? :
541 12 4 $_[0] < 10 ? :
547 21008 1405 unless @_
550 240 1165 unless @_ > 1 or ref $_[0]
553 22 1143 ref $_[0] ? :
560 0 826 unless my $class = shift()