Branch Coverage

lib/Text/PO/Gettext.pm
Criterion Covered Total %
branch 81 146 55.4


line true false branch
57 0 2 unless $self->SUPER::init(@_)
58 0 2 unless (defined $self->{'path'} and length $self->{'path'})
62 0 2 unless $self->textdomain($self->{'domain'})
71 0 0 unless defined $locale and length $locale
72 0 0 unless defined $key and length $key
74 0 0 unless ($self->isSupportedLanguage($locale))
98 8 6 if ref $_[-1] eq "HASH"
102 10 4 unless (defined $count and $count =~ /^\d+$/)
106 7 7 unless (exists $opts->{'locale'} and length $opts->{'locale'})
112 0 14 unless (exists $$hash{$opts->{'locale'}})
114 0 0 if warnings::enabled()
119 14 0 if ($dict) { }
121 0 14 if ($plural->length == 0)
125 4 10 if (ref $dict->{'msgstr'} eq "ARRAY")
127 4 0 if ($self->_is_number($count) and int $plural->[0] > 0) { }
143 4 0 if length "$locale_str"
150 0 0 if warnings::enabled()
158 2 38 if (@_)
161 0 2 if (not $v) { }
0 2 elsif (not $v =~ /^$Text::PO::Gettext::DOMAIN_RE$/) { }
172 0 2 unless $caller eq "Module::Generic::init"
182 0 2 if (not defined $lang) { }
0 2 elsif (not length $lang) { }
0 2 elsif (not $lang =~ /^$Text::PO::Gettext::LOCALE_RE$/) { }
223 1 1 if ($opts->{'monday_first'})
237 1 1 if ($opts->{'monday_first'})
252 0 38 unless (exists $$hash{$opts->{'domain'}})
257 18 20 if (exists $opts->{'locale'} and defined $opts->{'locale'})
261 0 18 if (length $opts->{'locale'} == 0)
276 0 2 unless ($lang =~ /^$Text::PO::Gettext::LOCALE_RE$/)
282 1 1 unless ($self->isSupportedLanguage($lang))
287 0 1 unless (exists $hash->{$lang})
301 1 0 if (scalar @$res > 0) { }
316 1 0 if (scalar @$res > 0) { }
386 0 2 unless defined $key and length $key
394 0 1 if ref $_[-1] eq "HASH"
415 0 3 unless exists $Text::PO::Gettext::L10N->{$dom}
417 2 1 if (exists $dict->{$lang}) { }
438 2 39 if (@_)
441 0 2 if (not defined $v && length $v) { }
2 0 elsif ($v =~ /^$Text::PO::Gettext::LOCALE_RE$/) { }
447 2 0 $+{'locale_country'} ? :
448 0 2 if $+{'locale_encoding'}
454 0 2 unless $self->{'domain'}
459 0 2 unless $caller eq "Module::Generic::init"
469 31 0 if ($loc =~ /^$Text::PO::Gettext::LOCALE_RE$/)
471 29 2 $+{'locale_country'} ? :
472 3 28 if $+{'locale_encoding'}
482 10 0 if ($loc =~ /^$Text::PO::Gettext::LOCALE_RE$/)
484 8 2 $+{'locale_country'} ? :
485 3 7 if $+{'locale_encoding'}
502 0 15 if (@_) { }
508 1 14 unless (scalar @{$self->{'plural'};})
534 2 0 $self->category ? :
535 2 0 $self->category ? :
536 2 0 $self->category ? :
541 2 0 if ($self->use_json and $path_json->exists) { }
0 0 elsif ($path_po->exists) { }
0 0 elsif ($path_mo->exists) { }
546 0 2 unless $po->parse2object($file)
554 0 0 unless $po->parse($file)
569 1 1 if ref $Text::PO::Gettext::L10N->{$dom} ne "HASH"
570 2 0 if ref $Text::PO::Gettext::L10N->{$dom}{$lang} ne "HASH"
590 4 0 if defined $locale
607 4 0 if defined $locale
620 2 0 if defined $locale
637 2 0 if defined $locale
647 2 0 if defined $locale
649 2 0 if defined $locale
654 0 2 if exists $def->{'currency'} and defined $def->{'currency'} and $def->{'currency'} eq "EUR"
655 0 0 if exists $lconv->{'currency_symbol'} and defined $lconv->{'currency_symbol'} and $lconv->{'currency_symbol'} eq "EUR"
656 0 2 if exists $lconv->{'grouping'} and defined $lconv->{'grouping'}
657 0 2 if exists $lconv->{'mon_grouping'} and defined $lconv->{'mon_grouping'}