Branch Coverage

blib/lib/Lingua/RU/Numeral.pm
Criterion Covered Total %
branch 220 220 100.0


line true false branch
57 1 7 unless defined wantarray
59 1 6 unless defined $number
70 1 2 unless defined wantarray
72 1 1 unless defined $number
94 1 1873 unless defined wantarray
96 1 1872 unless defined $number
105 1871 1 $gender =~ /^\s*(m|f|n)/i ? :
108 1871 1 $case =~ /^\s*([ngdaip])/i ? :
111 180 1692 $multi =~ /^\s*[p1-9]/i ? :
114 167 1705 $object =~ /^\s*[a1-9]/i ? :
122 69 1803 unless ($number)
123 1 68 exists $cfg{'alt'}{'0'} ? :
126 3 66 $case =~ /^a/i && $object =~ /^animate/i ? :
136 29 40 if (exists $epilog->{'root'})
143 5 64 if exists $cfg{'ucfirst'}
145 1 68 wantarray ? :
148 1 1802 if length $number > 15
162 430 3294 if ($number =~ /^.$/)
166 27 363 $case =~ /^a/i && $object =~ /^animate/i ? :
40 390 $multi =~ /^plural/i && $number == 1 ? :
169 180 250 if (exists $epilog->{'root'})
173 144 68 $number < 5 ? :
185 1364 1930 if ($i < 2) { }
196 771 2523 if (length($number) % 3 == 0) { }
1180 1343 elsif (length($number) % 3 == 2) { }
198 505 266 if $&
201 276 904 if ($number =~ /^1/) { }
205 34 242 if length $Power->[$i]
209 320 584 if $&
215 951 392 if ($d)
216 136 815 $multi =~ /^plural/i && $d == 1 ? :
219 1196 147 unless ($s[-1] =~ /^(?:\x{43c}|\x{442}\x{440}\x{438}\x{43b})/)
221 35 101 $i < 2 ? :
923 137 $d < 5 ? :
136 1060 $multi =~ /^plural/i && $d == 1 ? :
227 911 432 if $number =~ /^0+$/
233 180 1622 defined $ns ? :
235 90 1712 if exists $cfg{'ucfirst'}
238 387 1415 if (exists $epilog->{'root'})
241 270 117 $s[-1] =~ /^(?:\x{442}\x{44b}|\x{43c}\x{438}|\x{442}\x{440}\x{438}\x{43b})/ ? :
252 6 1796 wantarray ? :
491 1591 2013 if exists $gg{$g}
498 4080 36180 if $case =~ /^a/i and $object =~ /^animate/i
505 8 301 if ($case =~ /^i/ and exists $cfg->{'alt'})
508 3 5 if (defined $cfg->{'alt'}{$k} and $cfg->{'alt'}{$k} =~ /^(C|O)/i)
513 3 5 if (exists $cfg->{'alt'}{$k})
520 3 6 if exists $gg{$g}
527 2 6 if exists $cfg->{'alt'}{'if1'}
531 6 397 if ($case =~ /^a/i and $object =~ /^animate/i and $multi =~ /^plural/i)
544 1642 229 if not @$prolog or ~~@$prolog < 2 and not defined $prolog->[0] && length $prolog->[0]
547 2 227 !(defined $prolog->[0] && length $prolog->[0]) || $prolog->[0] =~ /=/ ? :
554 2 145 unless $_
557 2 143 unless $k and $m
559 47 96 if ($s->[0] =~ /^$m/)
567 180 49 if (defined $p)
580 1066 205 if (ref $prolog eq 'ARRAY') { }
3 202 elsif (ref $prolog eq 'HASH') { }
201 1 elsif (ref \$prolog eq 'SCALAR') { }
581 29 1037 ~~@$prolog ? :
588 1 3 unless length $k or $v
590 2 1 if (length $v) { }
597 2 1 ~~@p ? :
603 6 195 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)
624 6 189 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) { }
3 186 elsif ($prolog =~ /^\x{431}\x{43b}\x{430}\x{433}\x{43e}\x{434}\x{430}\x{440}\x{44f}$/i) { }
636 2 1 unless $$case =~ /^[d]/
641 6 180 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)
650 6 174 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)
659 6 168 if ($prolog =~ /^\x{43f}\x{440}\x{438}$/i)
665 6 162 if ($prolog =~ /^\x{441}\x{43e}\x{433}\x{43b}\x{430}\x{441}\x{43d}\x{43e}$/i)
666 4 2 unless $$case =~ /^[gd]/
671 3 159 if ($prolog =~ /^(?:\x{43f}\x{440}\x{43e})?\x{43c}\x{435}\x{436}(?:\x{434}\x{443})?$/i)
672 2 1 unless $$case =~ /^[gi]/
677 6 153 if ($prolog =~ /^(?:\x{437}\x{430}|\x{43f}\x{43e}\x{434}\x{43e}?)$/i)
678 4 2 unless $$case =~ /^[ai]/
683 4 149 if ($prolog =~ /^[\x{432}\x{412}B][\x{41e}\x{43e}Oo]?$/) { }
66 83 elsif ($prolog =~ /^[oO\x{43e}\x{41e}][\x{431}\x{411}]?[oO\x{43e}\x{41e}]?$/) { }
4 79 elsif ($prolog =~ /^\x{43d}\x{430}$/i) { }
685 3 1 unless $$case =~ /^[ap]/
689 1 65 unless $$case =~ /^[ap]/
693 3 1 unless $$case =~ /^[ap]/
698 75 4 if ($prolog =~ /^[cC\x{441}\x{421}][\x{41e}\x{43e}Oo]?$/)
699 4 71 unless $$case =~ /^[agi]/
704 3 1 if ($prolog =~ /^\x{43f}\x{43e}$/i)
705 2 1 unless $$case =~ /^[adp]/
717 169 1703 unless my $epilog = $cfg->{'epilog'}
719 575 1128 if (ref \$epilog eq 'SCALAR') { }
23 1105 elsif (ref $epilog eq 'HASH' and exists $epilog->{'root'} and exists $epilog->{'ends'}) { }
722 153 422 if ($epilog =~ /^(?:RU[BR]|643|810|\x{20bd}|(?i:\x{440}\x{443}\x{431}\x{43b}\x{44c}|ruble))$/) { }
98 324 elsif ($epilog =~ /^(?:BY[BRN]|Br|933|974)$/) { }
160 164 elsif ($epilog =~ /^(?:ru[br]|\-643|\-810|by[brn]|\-933|\-974|(?i:\x{43a}\x{43e}\x{43f}\x{435}\x{439}\x{43a}\x{430}|kopek))$/) { }
149 15 elsif ($epilog =~ /^(?:USD|840|(?:US)?\$|(?i:\x{434}\x{43e}\x{43b}\x{43b}\x{430}\x{440}|dollar))$/) { }
1 14 elsif ($epilog =~ /^(?:usd|\-840|(?i:\x{446}\x{435}\x{43d}\x{442}|cent))$/) { }
3 11 elsif ($epilog =~ /^(?:CNY|RMB|156|(?i:\x{44e}\x{430}\x{43d}\x{44c}|yuan))$/) { }
1 10 elsif ($epilog =~ /^(?:cny|rmb|-156|(?i:\x{444}\x{44b}\x{43d}\x{44c}))$/) { }
1 9 elsif ($epilog =~ /^(?:year|\x{433}\x{43e}\x{434}|\x{43b}\x{435}\x{442})$/i) { }
1 8 elsif ($epilog =~ /^(?:month|\x{43c}\x{435}\x{441}\x{44f}\x{446})$/i) { }
1 7 elsif ($epilog =~ /^(?:day|\x{434}\x{435}\x{43d}\x{44c})$/i) { }
1 6 elsif ($epilog =~ /^(?:hour|\x{447}\x{430}\x{441})$/i) { }
1 5 elsif ($epilog =~ /^(?:min|\x{43c}\x{438}\x{43d})/i) { }
1 4 elsif ($epilog =~ /^(?:sec|\x{441}\x{435}\x{43a})/i) { }
1 3 elsif ($epilog =~ /^(?:meter|\x{43c}\x{435}\x{442}\x{440})$/i) { }
1 2 elsif ($epilog =~ /^(?:stamp|\x{43f}\x{435}\x{447}\x{430}\x{442})/i) { }
978 573 2 if (%eRef) { }
983 122 451 if ($multi =~ /^plural/i)
984 92 30 if (ref \$eRef{'plural'}{$case} eq 'SCALAR') { }
997 475 98 if (ref \$eRef{'root'} eq 'SCALAR') { }
1012 21 2 if (defined $epilog->{'object'})
1013 3 18 $epilog->{'object'} =~ /^\s*[a1-9]/i ? :
1017 21 2 if defined $epilog->{'gender'} and $epilog->{'gender'} =~ /^\s*(m|f|n)/i