Branch Coverage

blib/lib/Locale/CLDR/NumberFormatter.pm
Criterion Covered Total %
branch 110 182 60.4


line true false branch
20 0 775 if ($self->numbering_system->{$numbering_system}{'type'} eq "algorithmic")
43 5 772 if (grep {$_ eq $format;} @valid_formats)
48 0 772 if (my($locale_id, $type, $format) = $format =~ m[^(.*?)/(.*?)/(.*?)$]u)
57 17 755 if ($format =~ tr/\244//)
61 17 0 unless defined $currency
97 16 18 $for_cash ? :
105 8 9 $for_cash ? :
117 747 27 if exists $cache{$format}
119 17 10 if defined $currency
129 43 11 if (($prefix) = $to_parse =~ /^ ( (?: [^0-9\@#.,E'*] | (?: ' [^']* ' )++ )+ ) /ux)
132 15 39 if (($suffix) = $to_parse =~ / ( (?: [^0-9\@#.,E'] | (?: ' [^']* ' )++ )+ ) $ /ux)
146 0 54 if (($pad_character) = $prefix =~ /^\*(\p{Any})/u) { }
0 54 elsif (($pad_character) = $prefix =~ /\*(\p{Any})$/u) { }
0 54 elsif (($pad_character) = $suffix =~ /^\*(\p{Any})/u) { }
1 53 elsif (($pad_character) = $suffix =~ /\*(\p{Any})$/u) { }
163 1 53 defined $pad_character ? :
169 4 50 if $prefix =~ tr/%// or $suffix =~ tr/%//
170 2 52 if $prefix =~ tr/\x{2030}// or $suffix =~ tr/\x{2030}//
175 34 20 if defined $currency
181 0 54 if (my($digits) = $to_parse =~ /(\@+)/u) { }
196 0 54 if ($to_parse =~ tr/E//) { }
236 0 17 if ($increment)
243 17 0 if ($decimal_digits) { }
278 0 772 if exists $symbols{$symbols_type}{'alias'}
280 12 760 $number =~ s/^-//u ? :
284 17 755 if ($format->{'rounding'} or defined $for_cash)
287 17 0 if (defined $for_cash)
295 4 768 if ($pad_zero > 0)
303 772 0 $minimum_grouping_digits ? :
308 772 0 if ($minimum_grouping_digits and length $integer >= $minimum_grouping_digits or not $minimum_grouping_digits) { }
311 27 745 if (defined $minor_group and $separator) { }
324 19 753 if defined $decimal
335 24 1520 if ($type eq 'negative') { }
357 0 773 unless $self->numbering_system->{$numbering_system}{'type'} eq "numeric"
389 0 8 unless $format_data
398 0 8 if (my($locale_id, undef, $format) = $format_name =~ m[^(.*?)/(.*?)/(.*?)$]u)
400 0 0 if $locale
413 2 8 unless $data->{$format_name}
414 0 8 unless $data->{$format_name}{$type}
423 8 0 keys %data ? :
430 0 1 unless defined $result
443 3 11 if (not $plural and $format_rule =~ /(cardinal|ordinal)/u)
450 3 11 if ($plural)
458 1 13 if ($number =~ /^-/u) { }
2 11 elsif ($number =~ /\./u) { }
462 1 0 if ($format_rule =~ /\x{2192}\x{2192}/u) { }
0 0 elsif (my($rule_name) = $format_rule =~ /\x{2192}(.+)\x{2192}/u) { }
0 0 elsif ($format_rule =~ /=%%.*=/u) { }
0 0 elsif ($format_rule =~ /=%.*=/u) { }
0 0 elsif ($format_rule =~ /=.*=/u) { }
467 0 0 if ($rule_name =~ s/^%%/%/u)
471 0 0 if ($format_data) { }
495 2 0 if ($number >= 0 and $number < 1) { }
502 1 1 if ($format_rule =~ /\x{2192}\x{2192}/u) { }
0 1 elsif (my($rule_name) = $format_rule =~ /\x{2192}(.*)\x{2192}/u) { }
507 0 0 if ($rule_name =~ s/^%%/%/u)
511 0 0 if ($format_data) { }
519 1 1 if ($format_rule =~ /\x{2190}\x{2190}/u) { }
0 1 elsif (my($rule_name) = $format_rule =~ /\x{2190}(.+)\x{2190}/u) { }
524 0 0 if ($rule_name =~ s/^%%/%/u)
528 0 0 if ($format_data) { }
536 1 1 if ($format_rule =~ /=.*=/u)
537 0 1 if ($format_rule =~ /=%%.*=/u) { }
1 0 elsif ($format_rule =~ /=%.*=/u) { }
552 3 8 if ($format_rule =~ /\[.*\]/u)
553 0 3 if ($in_fraction_rule_set and $number * $base_value == 1) { }
0 3 elsif (not $in_fraction_rule_set || $number % $divisor) { }
565 2 9 if ($in_fraction_rule_set) { }
566 0 2 if (my($rule_name) = $format_rule =~ /\x{2190}(.*)\x{2190}/u) { }
0 2 elsif ($format_rule =~ /=.*=/u) { }
567 0 0 if (length $rule_name) { }
569 0 0 if ($rule_name =~ s/^%%/%/u)
573 0 0 if ($format_data) { }
589 3 6 if (my($rule_name) = $format_rule =~ /\x{2192}(.*)\x{2192}/u)
590 0 3 if (length $rule_name) { }
592 0 0 if ($rule_name =~ s/^%%/%/u)
596 0 0 if ($format_data) { }
608 0 9 if (my($rule_name) = $format_rule =~ /\x{2190}(.*)\x{2190}/u)
609 0 0 if (length $rule_name) { }
611 0 0 if ($rule_name =~ s/^%%/%/u)
615 0 0 if ($format_data) { }
627 4 5 if ($format_rule =~ /=.*=/u)
628 0 4 if ($format_rule =~ /=%%.*=/u) { }
2 2 elsif ($format_rule =~ /=%.*=/u) { }
659 1 0 if $number =~ /^-/u and exists $format_data->{'-x'}
660 1 1 if $number =~ /\./u and exists $format_data->{'x.x'}
661 6 6 if $number == bless( {"sign" => "+","value" => bless( [0], 'Math::BigInt::Calc' )}, 'Math::BigInt' ) or $number =~ /^-/u
662 2 4 if $number >= $format_data->{'max'}{'base_value'}
666 4 67 if $key == bless( {"sign" => "+","value" => bless( [0], 'Math::BigInt::Calc' )}, 'Math::BigInt' )
667 1 66 if $number == $key
668 3 63 if $number < $key