Branch Coverage

blib/lib/Locale/CLDR/NumberFormatter.pm
Criterion Covered Total %
branch 108 182 59.3


line true false branch
20 0 769 if ($self->numbering_system->{$numbering_system}{'type'} eq 'algorithmic')
43 5 766 if (grep {$_ eq $format;} @valid_formats)
48 0 766 if (my($locale_id, $type, $format) = $format =~ m[^(.*?)/(.*?)/(.*?)$]u)
57 17 749 if ($format =~ tr/\244//)
61 17 0 unless defined $currency
97 16 18 $for_cash ? :
105 8 9 $for_cash ? :
117 742 26 if exists $cache{$format}
119 17 9 if defined $currency
129 42 10 if (($prefix) = $to_parse =~ /^ ( (?: [^0-9\@#.,E'*] | (?: ' [^']* ' )++ )+ ) /ux)
132 15 37 if (($suffix) = $to_parse =~ / ( (?: [^0-9\@#.,E'] | (?: ' [^']* ' )++ )+ ) $ /ux)
146 0 52 if (($pad_character) = $prefix =~ /^\*(\p{Any})/u) { }
0 52 elsif (($pad_character) = $prefix =~ /\*(\p{Any})$/u) { }
0 52 elsif (($pad_character) = $suffix =~ /^\*(\p{Any})/u) { }
1 51 elsif (($pad_character) = $suffix =~ /\*(\p{Any})$/u) { }
163 1 51 defined $pad_character ? :
169 4 48 if $prefix =~ tr/%// or $suffix =~ tr/%//
170 2 50 if $prefix =~ tr/\x{2030}// or $suffix =~ tr/\x{2030}//
175 34 18 if defined $currency
181 0 52 if (my($digits) = $to_parse =~ /(\@+)/u) { }
196 0 52 if ($to_parse =~ tr/E//) { }
236 0 17 if ($increment)
242 17 0 if ($decimal_digits) { }
277 0 766 if exists $symbols{$symbols_type}{'alias'}
279 12 754 $number =~ s/^-//u ? :
283 17 749 if ($format->{'rounding'} or defined $for_cash)
286 17 0 if (defined $for_cash)
294 4 762 if ($pad_zero > 0)
302 766 0 $minimum_grouping_digits ? :
307 766 0 if ($minimum_grouping_digits and length $integer >= $minimum_grouping_digits or not $minimum_grouping_digits) { }
310 27 739 if (defined $minor_group and $separator)
320 19 747 if defined $decimal
331 24 1508 if ($type eq 'negative') { }
353 0 767 unless $self->numbering_system->{$numbering_system}{'type'} eq 'numeric'
385 0 8 unless $format_data
394 0 8 if (my($locale_id, undef, $format) = $format_name =~ m[^(.*?)/(.*?)/(.*?)$]u)
396 0 0 if $locale
409 2 8 unless $data->{$format_name}
410 0 8 unless $data->{$format_name}{$type}
419 8 0 keys %data ? :
426 0 1 unless defined $result
439 3 11 if (not $plural and $format_rule =~ /(cardinal|ordinal)/u)
446 3 11 if ($plural)
454 2 12 if ($number =~ /^-/u) { }
1 11 elsif ($number =~ /\./u) { }
458 1 1 if ($format_rule =~ /\x{2192}\x{2192}/u) { }
0 1 elsif (my($rule_name) = $format_rule =~ /\x{2192}(.+)\x{2192}/u) { }
0 1 elsif ($format_rule =~ /=%%.*=/u) { }
1 0 elsif ($format_rule =~ /=%.*=/u) { }
0 0 elsif ($format_rule =~ /=.*=/u) { }
463 0 0 if ($rule_name =~ s/^%%/%/u)
467 0 0 if ($format_data) { }
491 1 0 if ($number >= 0 and $number < 1) { }
498 1 0 if ($format_rule =~ /\x{2192}\x{2192}/u) { }
0 0 elsif (my($rule_name) = $format_rule =~ /\x{2192}(.*)\x{2192}/u) { }
503 0 0 if ($rule_name =~ s/^%%/%/u)
507 0 0 if ($format_data) { }
515 1 0 if ($format_rule =~ /\x{2190}\x{2190}/u) { }
0 0 elsif (my($rule_name) = $format_rule =~ /\x{2190}(.+)\x{2190}/u) { }
520 0 0 if ($rule_name =~ s/^%%/%/u)
524 0 0 if ($format_data) { }
532 0 1 if ($format_rule =~ /=.*=/u)
533 0 0 if ($format_rule =~ /=%%.*=/u) { }
0 0 elsif ($format_rule =~ /=%.*=/u) { }
548 3 8 if ($format_rule =~ /\[.*\]/u)
549 0 3 if ($in_fraction_rule_set and $number * $base_value == 1) { }
0 3 elsif (not $in_fraction_rule_set || $number % $divisor) { }
561 2 9 if ($in_fraction_rule_set) { }
562 0 2 if (my($rule_name) = $format_rule =~ /\x{2190}(.*)\x{2190}/u) { }
0 2 elsif ($format_rule =~ /=.*=/u) { }
563 0 0 if (length $rule_name) { }
565 0 0 if ($rule_name =~ s/^%%/%/u)
569 0 0 if ($format_data) { }
585 3 6 if (my($rule_name) = $format_rule =~ /\x{2192}(.*)\x{2192}/u)
586 0 3 if (length $rule_name) { }
588 0 0 if ($rule_name =~ s/^%%/%/u)
592 0 0 if ($format_data) { }
604 0 9 if (my($rule_name) = $format_rule =~ /\x{2190}(.*)\x{2190}/u)
605 0 0 if (length $rule_name) { }
607 0 0 if ($rule_name =~ s/^%%/%/u)
611 0 0 if ($format_data) { }
623 4 5 if ($format_rule =~ /=.*=/u)
624 0 4 if ($format_rule =~ /=%%.*=/u) { }
2 2 elsif ($format_rule =~ /=%.*=/u) { }
655 1 1 if $number =~ /^-/u and exists $format_data->{'-x'}
656 1 1 if $number =~ /\./u and exists $format_data->{'x.x'}
657 6 6 if $number == {sign => '+', value => [0]} or $number =~ /^-/u
658 2 4 if $number >= $format_data->{'max'}{'base_value'}
662 4 67 if $key == {sign => '+', value => [0]}
663 1 66 if $number == $key
664 3 63 if $number < $key