Branch Coverage

blib/lib/Lingua/RU/Numeral.pm
Criterion Covered Total %
branch 146 194 75.2


line true false branch
63 1770 0 $gender =~ /^\s*(m|f|n)/i ? :
66 1770 0 $case =~ /^\s*([ngdaip])/i ? :
69 176 1594 $multi =~ /^\s*[p1-9]/i ? :
72 166 1604 $object =~ /^\s*[a1-9]/i ? :
80 55 1715 unless ($number)
81 1 54 exists $cfg{'alt'}{'0'} ? :
84 3 52 $case =~ /^a/i && $object =~ /^animate/i ? :
93 26 29 if ($epilog and exists $epilog->{'root'})
100 5 50 if exists $cfg{'ucfirst'}
105 1 1714 if length $number > 15
119 625 3223 if ($number =~ /^.$/)
120 216 409 unless $number
124 26 345 $case =~ /^a/i && $object =~ /^animate/i ? :
38 371 $multi =~ /^plural/i && $number == 1 ? :
127 166 243 if ($epilog and exists $epilog->{'root'})
131 133 65 $number < 5 ? :
142 1295 1928 if ($i < 2) { }
153 768 2455 if (length($number) % 3 == 0)
155 502 266 if $&
159 1123 1332 if (length($number) % 3 == 2)
160 223 900 if ($number =~ /^1/) { }
162 223 0 if $&
164 34 189 if length $Power->[$i]
168 319 581 if $&
174 1332 0 if (length($number) % 3 == 1)
177 941 391 if ($d)
178 136 805 $multi =~ /^plural/i && $d == 1 ? :
181 1185 147 unless ($s[-1] =~ /^(?:\x{43c}|\x{442}\x{440}\x{438}\x{43b})/)
183 35 101 $i < 2 ? :
136 1049 $multi =~ /^plural/i && $d == 1 ? :
189 900 432 if $number =~ /^0+$/
196 89 1625 if exists $cfg{'ucfirst'}
199 380 1334 if ($epilog and exists $epilog->{'root'})
202 267 113 $s[-1] =~ /^(?:\x{442}\x{44b}|\x{43c}\x{438}|\x{442}\x{440}\x{438}\x{43b})/ ? :
444 1503 1925 if exists $gg{$g}
451 4040 34460 if $case =~ /^a/i and $object =~ /^animate/i
457 5 382 if ($case =~ /^a/i and $object =~ /^animate/i and $multi =~ /^plural/i)
470 1597 172 if not @$prolog && @$s or ~~@$prolog < 2 and not defined $prolog->[0] && length $prolog->[0]
476 0 136 unless $_
479 0 136 unless $k and $m
481 44 92 if ($s->[0] =~ /^$m/)
489 128 44 if (defined $p and length $p)
502 1062 147 if (ref $prolog eq "ARRAY")
503 25 1037 ~~@$prolog ? :
506 0 147 if (ref $prolog eq "HASH")
509 0 0 if (defined $prolog->{$k} and length $prolog->{$k}) { }
519 0 0 ~~@p ? :
522 147 0 if (ref \$prolog eq "SCALAR")
526 1 146 if ($prolog =~ /^(?: \x{431}\x{435}\x{437}\x{43e}?| \x{432}(?:\x{431}\x{43b}\x{438}\x{437}\x{438}|\x{432}\x{438}\x{434}\x{443}|\x{434}\x{43e}\x{43b}\x{44c}|\x{437}\x{430}\x{43c}\x{435}\x{43d}|\x{43a}\x{440}\x{443}\x{433}|\x{43c}\x{435}\x{441}\x{442}\x{43e}|\x{43d}\x{435}|\x{43d}\x{438}\x{437}\x{443}|\x{43d}\x{443}\x{442}\x{440}[\x{438}\x{44c}]|\x{43f}\x{435}\x{440}\x{435}\x{434}\x{438}?|\x{440}\x{43e}\x{434}\x{435}|\x{43e}\x{432}\x{43d}\x{443}\x{442}\x{440}\x{44c}|\x{43e}\x{437}\x{43b}\x{435}|\x{43e}\x{43a}\x{440}\x{443}\x{433}|\x{441}\x{43b}\x{435}\x{434}\x{441}\x{442}\x{432}\x{438}\x{435}|\x{44b}\x{448}\x{435})| \x{434}\x{43b}\x{44f}|\x{434}\x{43e}| \x{438}\x{437}(?:\x{43e}?|\-\x{437}\x{430}|\x{43d}\x{443}\x{442}\x{440}\x{438}|\-\x{43f}\x{43e}\x{434}\x{43e}?)| \x{43a}\x{430}\x{441}\x{430}(?:\x{435}\x{43c}|\x{442}\x{435}\x{43b}\x{44c}\x{43d})\x{43e}|\x{43a}\x{440}\x{43e}\x{43c}\x{435}|\x{43a}\x{440}\x{443}\x{433}\x{43e}\x{43c}| \x{43c}\x{438}\x{43c}\x{43e}| \x{43d}\x{430}(?:\x{43a}\x{430}\x{43d}\x{443}\x{43d}\x{435}|\x{43c}\x{435}\x{441}\x{442}\x{43e}|\x{43f}\x{43e}\x{434}\x{43e}\x{431}\x{438}\x{435}|\x{43f}\x{440}\x{43e}\x{442}\x{438}\x{432}|\x{441}\x{443}\x{43f}\x{440}\x{43e}\x{442}\x{438}\x{432}|\x{441}\x{447}\x{435}\x{442})|\x{43d}\x{438}\x{436}\x{435}| \x{43e}(?:\x{431}\x{43e}\x{43a}|\x{431}\x{43e}\x{447}\x{44c}|\x{43a}\x{43e}\x{43b}\x{43e}|\x{43a}\x{440}\x{435}\x{441}\x{442}|\x{43a}\x{440}\x{443}\x{433}|\x{43f}\x{440}\x{438}\x{447}\x{44c}|\x{442}\x{43e}?|\x{442}\x{43d}\x{43e}\x{441}\x{438}\x{442}\x{435}\x{43b}\x{44c}\x{43d}\x{43e})| \x{43f}\x{43e}(?:\x{431}\x{43b}\x{438}\x{437}\x{43e}\x{441}\x{442}\x{438}|\x{432}\x{435}\x{440}\x{445}|\x{434}\x{43b}\x{435}|\x{437}\x{430}\x{434}[\x{438}\x{44c}]|\x{43c}\x{438}\x{43c}\x{43e}|\x{43f}\x{435}\x{440}\x{435}\x{43a}|\x{441}\x{435}?\x{440}\x{435}\x{434}\x{438}(?:\x{43d}\x{435})?|\x{441}\x{435}\x{440}\x{435}\x{434}\x{44c}|\x{441}\x{43b}\x{435}|\x{441}\x{440}\x{435}\x{434}\x{441}\x{442}\x{432}\x{43e}\x{43c})| \x{43f}\x{440}(?:\x{435}\x{432}\x{44b}\x{448}\x{435}|\x{43e}\x{442}\x{438}\x{432})|\x{43f}\x{443}\x{442}\x{435}\x{43c}| \x{440}\x{430}\x{434}\x{438}| \x{441}(?:\x{432}\x{435}\x{440}\x{445}\x{443}?|\x{432}\x{44b}\x{448}\x{435}|\x{435}\x{440}\x{435}\x{434}\x{44c}|\x{437}\x{430}\x{434}\x{438}|\x{438}\x{43b}\x{430}\x{43c}\x{438}|\x{43d}\x{430}\x{440}\x{443}\x{436}\x{438}|\x{43d}\x{438}\x{437}\x{443}|\x{43f}\x{435}\x{440}\x{435}\x{434}\x{438}|\x{440}\x{435}\x{434}[\x{438}\x{44c}]|\x{443}\x{43f}\x{440}\x{43e}\x{442}\x{438}\x{432})| \x{443} )$/xi)
547 1 145 if ($prolog =~ /^(?: \x{432}\x{434}\x{43e}\x{433}\x{43e}\x{43d}(?:\x{43a}\x{443}|\x{43e}\x{447}\x{43a}\x{443})?|\x{432}\x{43e}\x{441}\x{43b}\x{435}\x{434}|\x{432}\x{440}\x{430}\x{437}\x{440}\x{435}\x{437}|\x{432}\x{441}\x{43b}\x{435}\x{434}| \x{43a}\x{43e}?| \x{43d}\x{430}\x{43f}\x{435}\x{440}\x{435}(?:\x{43a}\x{43e}\x{440}|\x{440}\x{435}\x{437})| \x{43f}\x{43e}\x{434}\x{43e}\x{431}\x{43d}\x{43e}|\x{43f}\x{440}\x{43e}\x{442}\x{438}\x{432}\x{43d}\x{43e}| \x{441}\x{43e}\x{43e}(?:\x{431}\x{440}\x{430}\x{437}|\x{442}\x{432}\x{435}\x{442}\x{441}\x{442}\x{432}\x{435}\x{43d})\x{43d}\x{43e}|\x{441}\x{43e}\x{440}\x{430}\x{437}\x{43c}\x{435}\x{440}\x{43d}\x{43e} )$/xi)
560 1 144 if ($prolog =~ /^(?: (?:\x{432}\x{44b}?|\x{438}\x{441})\x{43a}\x{43b}\x{44e}\x{447}\x{430}\x{44f}|\x{43f}\x{440}\x{43e}|\x{441}\x{43a}\x{432}\x{43e}\x{437}\x{44c}|\x{441}\x{43f}\x{443}\x{441}\x{442}\x{44f}|\x{447}\x{435}?\x{440}\x{435}\x{437} )$/xi)
569 1 143 if ($prolog =~ /^(?: \x{43a}\x{43e}\x{43d}\x{447}\x{430}\x{44f}|\x{43d}\x{430}\x{434}\x{43e}?|\x{43d}\x{430}\x{447}\x{438}\x{43d}\x{430}\x{44f}|\x{43f}\x{435}\x{440}\x{435}\x{434}\x{43e}?|\x{43f}\x{43e}\-[\x{437}\x{43d}]\x{430}\x{434}? )$/xi)
578 1 142 if ($prolog =~ /^\x{43f}\x{440}\x{438}$/i)
584 1 141 if ($prolog =~ /^\x{441}\x{43e}\x{433}\x{43b}\x{430}\x{441}\x{43d}\x{43e}$/i)
585 1 0 unless $$case and $$case =~ /^[gd]/
590 1 140 if ($prolog =~ /^(?:\x{43f}\x{440}\x{43e})?\x{43c}\x{435}\x{436}(?:\x{434}\x{443})?$/i)
591 1 0 unless $$case and $$case =~ /^[gi]/
596 1 139 if ($prolog =~ /^\x{431}\x{43b}\x{430}\x{433}\x{43e}\x{434}\x{430}\x{440}\x{44f}$/i)
597 1 0 unless $$case and $$case =~ /^[ad]/
602 1 138 if ($prolog =~ /^(?:\x{437}\x{430}|\x{43f}\x{43e}\x{434}\x{43e}?)$/i)
603 1 0 unless $$case and $$case =~ /^[ai]/
608 1 137 if ($prolog =~ /^[\x{432}\x{412}B][\x{41e}\x{43e}Oo]?$/) { }
65 72 elsif ($prolog =~ /^[oO\x{43e}\x{41e}][\x{431}\x{411}]?[oO\x{43e}\x{41e}]?$/) { }
1 71 elsif ($prolog =~ /^\x{43d}\x{430}$/i) { }
610 1 0 unless $$case and $$case =~ /^[ap]/
614 1 64 unless $$case and $$case =~ /^[ap]/
618 1 0 unless $$case and $$case =~ /^[ap]/
623 70 1 if ($prolog =~ /^[cC\x{441}\x{421}][\x{41e}\x{43e}Oo]?$/)
624 0 70 unless $$case and $$case =~ /^[agi]/
629 1 0 if ($prolog =~ /^\x{43f}\x{43e}$/i)
630 1 0 unless $$case and $$case =~ /^[adp]/
642 94 1676 unless my $epilog = $cfg->{'epilog'}
644 555 1121 if (ref \$epilog eq 'SCALAR') { }
17 1104 elsif (ref $epilog eq 'HASH' and exists $epilog->{'root'} and exists $epilog->{'ends'}) { }
647 149 406 if ($epilog =~ /^(?:RUB|643)$/) { }
97 309 elsif ($epilog =~ /^(?:BYR|974)$/) { }
160 149 elsif ($epilog =~ /^(?:rub|\-643|byr|\-974)$/) { }
149 0 elsif ($epilog =~ /^(?:USD|840)$/) { }
0 0 elsif ($epilog =~ /^(?:usd|\-840)$/) { }
0 0 elsif ($epilog =~ /^(?:CNY|156)$/) { }
0 0 elsif ($epilog =~ /^year$/i) { }
0 0 elsif ($epilog =~ /^month$/i) { }
0 0 elsif ($epilog =~ /^day$/i) { }
0 0 elsif ($epilog =~ /^hour$/i) { }
0 0 elsif ($epilog =~ /^min\.$/i) { }
0 0 elsif ($epilog =~ /^sec\.$/i) { }
0 0 elsif ($epilog =~ /^meter$/i) { }
0 0 elsif ($epilog =~ /^stamp$/i) { }
889 555 0 if (%eRef) { }
894 122 433 if ($multi =~ /^plural/i)
895 92 30 if (ref \$eRef{'plural'}{$case} eq 'SCALAR') { }
30 0 elsif (ref $eRef{'plural'}{$case} eq 'ARRAY') { }
908 458 97 if (ref \$eRef{'root'} eq 'SCALAR') { }
97 0 elsif (ref $eRef{'root'} eq 'ARRAY') { }
923 17 0 if (exists $epilog->{'object'})
924 0 17 $epilog->{'object'} =~ /^\s*[a1-9]/i ? :
928 17 0 if exists $epilog->{'gender'} and $epilog->{'gender'} =~ /^\s*(m|f|n)/i