Branch Coverage

blib/lib/Locale/CLDR.pm
Criterion Covered Total %
branch 289 544 53.1


line true false branch
70 21 0 if (defined &CORE::fc) { }
600 0 0 unless $language eq 'und'
625 0 0 if $script
652 0 0 if $region
670 248 100 $_ ? :
677 18 98 $self->_has_likely_subtag ? :
18 98 $self->_has_likely_subtag ? :
18 98 $self->_has_likely_subtag ? :
684 248 100 unless $path[$i] eq 'und' or $path[$i] eq 'Any'
704 95 135 if ($canload) { }
714 20 95 if ($errors)
725 20 95 if (ref $module eq 'Locale::CLDR::Locales::Root')
1167 4 170 unless defined $name
1168 0 170 unless (defined $value)
1206 1 340 unless defined $regex
1208 340 0 unless $has_emoji
1211 0 340 unless $has_Grapheme_Cluster_Break_ZWJ
1214 0 340 unless $has_Grapheme_Cluster_Break_E_Base
1217 0 340 unless $has_Grapheme_Cluster_Break_E_Base_GAZ
1220 0 340 unless $has_Grapheme_Cluster_Break_E_Modifier
1223 0 340 unless $has_Word_Break_ZWJ
1226 0 340 unless $has_Word_Break_E_Base
1229 0 340 unless $has_Word_Break_E_Base_GAZ
1232 0 340 unless $has_Word_Break_E_Modifier
1235 340 0 unless $has_Word_Break_Hebrew_Letter
1238 340 0 unless $has_Word_Break_Single_Quote
1241 0 340 unless $has_Line_Break_ZWJ
1244 0 340 unless $has_Line_Break_E_Base
1247 340 0 unless $has_Line_Break_E_Base_GAZ
1250 0 340 unless $has_Line_Break_E_Modifier
1253 340 0 unless $has_Extended_Pictographic
1256 340 0 unless $has_Word_Break_WSegSpace
1276 0 112 unless defined $rules{$rule_number}
1282 189 35 if ($operand =~ / \S /msux) { }
1291 97 15 $opp eq "\327" ? :
1305 0 106 if (@_ > 1 and ref $_[-1] eq 'HASH')
1309 85 21 if (1 == @_ and not ref $_[0])
1319 1 84 if (not defined $script and length $language == 4)
1325 135 205 unless defined $_
1337 21 85 unless (keys %args)
1339 0 21 ref $_[0] ? :
1344 6 100 if (defined $args{'extensions'} and not ref $args{'extensions'})
1352 102 4 if defined $args{'language_id'}
1353 90 16 if defined $args{'script_id'}
1354 92 14 if defined $args{'region_id'}
1355 90 16 if defined $args{'variant_id'}
1494 66 2 if ($self->_test_default_ca) { }
1504 2 8 if ($default) { }
1520 20 0 if ($self->_test_default_cf) { }
1538 28 8 if ($self->script_id)
1542 28 8 if ($self->region_id)
1546 3 33 if ($self->variant_id)
1550 0 36 if (defined $self->extensions)
1565 0 0 if ($self->language_id eq 'en') { }
1638 3363 0 $self->_has_likely_subtag ? :
1643 3230 133 if ($self->method_cache->{$id}{$method_name})
1646 2451 779 wantarray ? :
1650 133 532 if $module eq 'Moo::Object'
1651 123 409 if (defined &{"${module}::$method_name";})
1656 52 81 unless $self->method_cache->{$id}{$method_name}
1659 66 15 wantarray ? :
1684 1 0 $name->region_id ? :
1 5 ref $name ? :
1692 4 2 if defined $display_name
1696 2 0 unless (ref $name)
1726 5 3 ref $name ? :
1730 7 1 if ($code)
1733 7 0 if (defined $display_name)
1741 1 7 unless (defined $language)
1744 1 0 if (defined $display_name)
1791 3 4 unless (ref $name)
1795 3 4 if (ref $name and not $name->script_id)
1801 3 1 if ($name)
1804 3 0 if (defined $script)
1810 1 3 unless ($script)
1813 1 0 if (defined $script)
1859 5 4 unless (ref $name)
1863 0 9 if (ref $name and not $name->region_id)
1869 7 2 if ($name)
1872 7 0 if (defined $region)
1878 2 7 unless (defined $region)
1881 2 0 if (defined $region)
1927 4 3 unless (ref $name)
1931 3 3 unless $name->variant_id
1933 3 0 if ($name->has_variant)
1937 2 1 if (defined $variant)
1965 0 2 unless exists $valid_keys{$key} or exists $valid_keys{$alias} or exists $valid_keys{$name}
1972 3 0 if defined $return and length $return
1998 0 2 unless exists $valid_keys{$key} or $valid_keys{$alias} or $valid_keys{$name}
1999 2 1 unless $valid_keys{$key}
3 0 unless $valid_keys{$alias}
1 2 unless $valid_keys{$name}
0 3 unless &first(sub { $_ eq $type; } , @{[] unless $valid_keys{$key};}, @{[] unless $valid_keys{$alias};}, @{[] unless $valid_keys{$name};})
2005 3 0 if defined $type
2023 2 4 if $name eq 'METRIC'
2028 6 0 if defined $system
2049 0 0 if length $key
2067 0 3 unless $type =~ / \A (?: language | script | region ) \z /ux
2073 0 3 unless &blessed($locale)
2081 0 3 unless defined $text
2104 0 2 unless defined $orientation
2116 0 0 if ($casing eq 'titlecase-firstword') { }
0 0 elsif ($casing eq 'titlecase-words') { }
0 0 elsif ($casing eq 'lowercase-words') { }
2119 0 0 if ($words[0] =~ / \A \s /ux)
2152 0 11 if $^V lt v5.18.0
2238 2790 160 unless (($first) = $string =~ / \G ($rule->[0]) $rule->[1] /msux)
2253 3 157 (!$grapheme_split && length $gc) > $length ? :
2260 105 59 $rules->[$_][2] ? :
2264 59 105 unless $split
2295 2 5 if @parameters == 1
2297 7 0 unless $parameters[0] eq 'index'
2302 2 8 unless defined $characters
2303 4 4 if CORE::fc($parameters[1]) =~ /$characters/u
2322 0 1 unless defined $characters
2334 0 6 unless defined $ellipsis
2449 0 3 unless defined $quote
2457 0 3 unless defined $quote
2465 0 3 unless defined $quote
2473 0 3 unless defined $quote
2491 3 0 if ($inner == -1 or $outer > -1 and $inner > -1 and $outer < $inner)
2518 0 1 unless defined $info
2610 728 20 if (exists $bundle->units->{$type}{$what}{$plural})
2615 0 20 if (exists $bundle->units->{$type}{$what}{'other'})
2622 10 728 unless ($format)
2627 0 10 unless $type
2629 4 12 if (exists $bundle->units->{$type}{$what}{$plural})
2634 0 12 if (exists $bundle->units->{$type}{$what}{'other'})
2644 6 732 if (not $format and my($dividend, $divisor) = $what =~ /^(.+)-per-(.+)$/u)
2649 0 732 unless $format
2663 6 0 if ($divisor)
2677 0 0 if (exists $bundle->units->{$type}{'per'}{''})
2684 0 0 unless ($format)
2690 0 0 if (exists $bundle->units->{$type}{'per'}{'1'})
2716 0 0 if (exists $bundle->units->{'long'}{$what}{'name'})
2726 0 0 unless $type
2728 0 0 if (exists $bundle->units->{$type}{$what}{'name'})
2743 4 4 if (exists $bundle->units->{$type}{$what}{'per'})
2752 0 2 unless $type
2754 2 0 if (exists $bundle->units->{$type}{$what}{'per'})
2770 0 24 if (exists $bundle->number_symbols->{$symbols_type}{'alias'})
2776 12 12 if exists $bundle->number_symbols->{$symbols_type}{'timeSeparator'}
2799 7 2 if $parsed =~ s/$entry/$self->format_number(shift @data, $num_format);/eu
2829 1 1 $test_str =~ $bundle->yesstr ? :
2846 1 1 $test_str =~ $bundle->nostr ? :
2879 0 0 ref $_ ? :
2884 0 0 if ($canload) { }
2909 0 0 unless pos $text < length $text
2923 0 0 if ($to_transform)
2925 0 0 if ($rule->{'type'} eq 'transform') { }
2944 0 0 if ($_ eq 'nfc') { }
0 0 elsif ($_ eq 'nfd') { }
0 0 elsif ($_ eq 'nfkd') { }
0 0 elsif ($_ eq 'nfkc') { }
0 0 elsif ($_ eq 'lower') { }
0 0 elsif ($_ eq 'upper') { }
0 0 elsif ($_ eq 'title') { }
0 0 elsif ($_ eq 'null') { }
0 0 elsif ($_ eq 'remove') { }
2985 0 0 if length $rule->{'before'} and not $text =~ /$rule->{'before'}\G/u
2987 0 0 if length $rule->{'after'}
2989 0 0 if length $rule->{'after'}
2990 0 0 if ($text =~ s/\G$regex/eval $result;/eu)
3020 1 4 unless @data
3021 1 3 if 1 == @data
3031 1 2 if (my $pattern = $list_data{scalar @data})
3114 0 16 if (exists $months->{$default_calendar}{'alias'})
3119 4 12 if (exists $months->{$default_calendar}{$type}{$width}{'alias'})
3125 8 4 if defined $result
3127 0 0 if ($default_calendar ne 'gregorian')
3187 0 13 if (exists $days->{$default_calendar}{'alias'})
3192 3 10 if (exists $days->{$default_calendar}{$type}{$width}{'alias'})
3197 7 3 if keys %$result
3199 0 0 if ($default_calendar ne 'gregorian')
3260 0 12 if (exists $quarters->{$default_calendar}{'alias'})
3265 3 9 if (exists $quarters->{$default_calendar}{$type}{$width}{'alias'})
3271 6 3 if keys %$result
3273 0 0 if ($default_calendar ne 'gregorian')
3338 0 0 $time < 1200 ? :
3357 0 38 if (exists $am_pm->{$default_calendar}{'alias'})
3362 0 38 if (exists $am_pm->{$default_calendar}{$type}{'alias'})
3367 9 29 if (exists $am_pm->{$default_calendar}{$type}{$width}{'alias'})
3377 80 84 unless exists $return{$_}
3465 0 9 if (exists $eras->{$default_calendar}{'alias'})
3470 0 9 if (exists $eras->{$default_calendar}{$width}{'alias'})
3480 9 0 if keys %$result
3482 0 0 if ($default_calendar ne 'gregorian')
3554 0 9 if (exists $date_formats->{'alias'})
3560 9 0 if $result
3562 0 0 if ($default_calendar ne 'gregorian')
3608 0 9 if (exists $time_formats->{$default_calendar}{'alias'})
3614 9 0 if ($result)
3620 0 0 if ($default_calendar ne 'gregorian')
3665 0 5 if (exists $datetime_formats->{$default_calendar}{'alias'})
3671 5 0 if $result
3673 0 0 if ($default_calendar ne 'gregorian')
3751 0 0 if $result
3784 0 0 if $result
3799 0 0 if $result
3807 1 0 $self->time_format_short =~ /h|K/u ? :
3833 0 189 unless length $regex
3865 330 6 if $set =~ /^ \s* # Possible white space \[ # Opening set ^? # Possible negation (?: # One of [^\[\]]++ # Not an open or close set | # Or (?<=\\)[\[\]] # An open or close set preceded by | # Or (?: \s* # Possible white space (?&posix) # A posix class (?! # Not followed by \s* # Possible white space [&-] # A Unicode regex op \s* # Possible white space \[ # A set opener ) ) )+ \] # Close the set \s* # Possible white space $ $posix /ux
330 6 if ($normal)
4013 2 2 if exists $week_data_hash->{$region_id}
4017 0 8 unless defined $region_id
4018 2 6 if exists $week_data_hash->{$region_id}
4050 2 1 if ($self->_test_default_fw)
4120 0 1 if ($context eq 'numeric') { }
4137 0 2 if (exists $month_patterns->{$default_calendar}{'alias'})
4143 1 1 if (exists $month_patterns->{$default_calendar}{$context}{$width}{'alias'})
4150 1 0 if $result
4152 0 0 if ($default_calendar ne 'gregorian')
4158 1 0 if ($result)
4189 0 3 if (my $alias_calendar = $cyclic_name_set->{$default_calendar}{'alias'})
4194 0 3 if (my $type_alias = $cyclic_name_set->{$default_calendar}{$type}{'alias'})
4199 1 2 if (my $width_alias = $cyclic_name_set->{$default_calendar}{$type}{$context}{$width}{'alias'})
4211 1 1 if @$return
4340 0 2 if defined $default_currency_format and $default_currency_format ne 'standard' and $default_currency_format ne 'accounting'
4353 0 22 if (exists $format->{$default_numbering_system}{'alias'})
4358 0 22 if (exists $format->{$default_numbering_system}{'pattern'}{'default'}{$default_currency_format}{'alias'})
4364 22 0 if exists $format->{$default_numbering_system}{'pattern'}{'default'}{$default_currency_format}
4367 10 12 if $default_currency_format eq 'account'
4373 11 11 defined $format->{$default_numbering_system}{'pattern'}{'default'}{$default_currency_format}{'negative'} ? :
4458 8 9 if $self->_test_default_cu
4462 0 9 unless ($region_id)
4469 9 0 if exists $default_currencies->{$region_id}
4473 0 0 unless $region_id
4474 0 0 if (exists $default_currencies->{$region_id})
4496 17 0 if $symbol
4608 0 1 if @_ % 2
4618 0 1 if @_ % 2
4625 0 8 unless grep {$_ eq $plural;} 'zero', 'one', 'two', 'few', 'many', 'other'
4649 2 7 unless $text =~ /\[/u
4656 2 6 if (length $raw)
4670 0 8 unless length $text
4675 0 8 if not length $method and length $text
4679 0 8 if $method =~ /^\[.*\[/u
4683 0 8 if (my($number) = $method =~ / \[ \s* _ [0-9]+ \s* \] /ux)
4684 0 0 if ($number == 0) { }
4703 6 2 if ($is_plural)
4709 0 8 unless exists $methods{lc $method}
4717 8 0 scalar @params ? :
8 0 scalar @params ? :
4735 0 0 unless $type ~~ ['ordinal', 'cardinal']
4738 0 0 unless $gender ~~ ['masculine', 'feminine', 'nuter']
4741 0 0 defined $declention ? :
4751 0 0 if exists $formats{$name}
4793 0 3 if (ref $params[-1] eq 'HASH')
4840 0 0 if $override = $bundle->collation->{$type}
4843 0 5 if ($type ne 'standard' and not $override)
4845 0 0 if $override = $bundle->collation->{'standard'}
4855 0 0 if ref $self->extensions and $self->extensions->{'co'}
4860 0 0 if $collation_type = $bundle->collation_type
4869 0 0 if ref $self->extensions and $self->extensions->{'ka'}
4874 0 0 if $collation_alternate = $bundle->collation_alternate
4883 0 0 if ref $self->extensions and $self->extensions->{'kb'}
4888 0 0 if $collation_backwards = $bundle->collation_backwards
4897 0 0 if ref $self->extensions and $self->extensions->{'kc'}
4902 0 0 if $collation_case_level = $bundle->collation_case_level
4911 0 0 if ref $self->extensions and $self->extensions->{'kf'}
4916 0 0 if $collation_case_ordering = $bundle->collation_case_ordering
4925 0 0 if ref $self->extensions and $self->extensions->{'kk'}
4930 0 0 if $collation_normalization = $bundle->collation_normalization
4939 0 0 if ref $self->extensions and $self->extensions->{'kn'}
4944 0 0 if $collation_numeric = $bundle->collation_numeric
4953 0 0 if ref $self->extensions and $self->extensions->{'kr'}
4958 0 0 if ref($collation_reorder = $bundle->collation_reorder) and @$collation_reorder
4968 0 1 if ($collation_strength)
4970 0 0 unless $collation_strength + 0
4978 0 0 if $collation_strength = $bundle->collation_strength
4987 0 0 if ref $self->extensions and $self->extensions->{'kv'}
4992 0 0 if $collation_max_variable = $bundle->collation_max_variable