Branch Coverage

blib/lib/Mojolicious/Plugin/Localize.pm
Criterion Covered Total %
branch 92 106 86.7


line true false branch
43 44 5 if $param->{'dict'}
44 2 47 if $param->{'resources'}
49 13 36 unless ($mojo->renderer->helpers->{'loc'})
52 1 12 if (my $c_param = $mojo->config("Localize"))
55 1 0 if $c_param->{'dict'}
58 0 1 if $c_param->{'override'}
61 1 0 if ($c_param->{'resources'})
79 4 120 unless scalar @_ and $_[0]
88 2 118 if @_ and @_ % 2 != 0
115 0 4 if $stash->{'localize.preference'}
138 3 46 if (@resources)
147 3 1 unless file_name_is_absolute($file)
153 4 0 if (-e $file)
154 4 0 if (my $dict = $config_loader->load($file, undef, $mojo))
179 4 45 $is_array ? :
191 1 11 if (substr($k, -1, 1) eq "_")
210 13 113 if ref $value or $value =~ /$TEMPLATE_INDICATOR/u
223 12 287 if (index($k, '_') > 0) { }
47 240 elsif ($k eq '_') { }
234 46 1 if ($override or not defined $dict_global->{'_'})
244 35 217 if (index($k, "-") == 0)
250 32 3 if (length $k > 1) { }
262 34 1 if ($override or not defined $dict_global->{'-'})
268 3 32 if $standalone
272 220 29 if (not $dict_global->{$k}) { }
24 5 elsif (ref $dict_global->{$k} eq ref $dict->{$k} and ref $dict_global->{$k} eq 'HASH') { }
3 2 elsif ($override) { }
275 97 123 if (ref $dict->{$k} eq 'HASH') { }
301 0 0 if ($i == $level) { }
324 298 53 if (my $primary = $key->[$level])
344 150 332 unless ($keys[$pos])
353 0 9 if ($lazy and $find_pref and $level >= $#{$key;})
358 9 141 if $lazy
361 3 138 if $dict->{'.'} and not $keys[0]
365 85 56 if ($dict->{'_'})
367 75 10 if ($matches[0])
379 74 67 if ($dict->{'-'})
384 74 0 if $match
387 46 95 unless $keys[$pos]
398 343 84 if (my $match = $$dict{$keys[$pos]})
409 112 231 if (!ref($match) || ref $match eq 'SCALAR' || ref $match eq 'CODE' and not $find_pref) { }
4 227 elsif (ref $match and $find_pref and $level > $#{$key;}) { }
412 112 0 if ($level >= $#{$key;})
415 83 29 if (ref $match eq 'SCALAR') { }
2 27 elsif (ref $match eq 'CODE') { }
439 27 0 unless delete $stash->{'no_trim'}
471 173 54 unless ($pos and $key->[$level])
484 180 47 if $found
517 0 85 unless $index
520 50 33 do { ref $index eq 'CODE' } ? :
83 2 ref $index ? :
523 2 0 unless delete $stash->{'no_trim'}
532 44 6 ref $pref ? :