Branch Coverage

lib/Locale/Intl.pm
Criterion Covered Total %
branch 116 280 41.4


line true false branch
39 2 123 if (exists $opts->{'language'})
42 1 1 if (defined $lang and length $lang) { }
47 1 0 if (my $locale2 = $loc->locale) { }
0 0 elsif (my $locale3 = $loc->locale3) { }
66 2 123 if (exists $opts->{'region'})
69 2 0 if (defined $region and length $region) { }
73 2 0 if ($region =~ /^[a-zA-Z]{2}$/) { }
0 0 elsif ($region =~ /^\d{3}$/) { }
107 13 0 if (exists $map->{$prop})
111 0 13 if (not defined $rv and $self->error)
118 0 125 if (scalar keys %$opts)
120 0 0 if warnings::enabled()
129 5 0 if (my $core = $self->core)
134 0 0 if (want("OBJECT"))
145 8 52 if (@_)
150 7 45 if (my $col = $self->SUPER::calendar)
155 0 45 if (want("OBJECT"))
165 3 3 if (my $cf = $self->colCaseFirst)
170 0 3 if (want("OBJECT"))
181 1 103 if (@_)
186 0 103 if (my $col = $self->SUPER::collation)
191 0 103 if (want("OBJECT"))
201 0 10 if (@_)
203 0 0 ref $_ eq 'CODE' ? :
208 0 0 if ($self->fatal) { }
214 0 0 if warnings::enabled()
215 0 0 if (want('ARRAY')) { }
0 0 elsif (want('OBJECT')) { }
226 10 0 ref $self ? :
264 3 1 unless ($cc = $self->country_code)
274 0 3 unless ($cals and ref $cals eq "ARRAY" and scalar @$cals)
278 1 0 if ($ref and $ref->{'calendars'} and ref($ref->{'calendars'} // '') eq 'ARRAY' and scalar @{$ref->{'calendars'};}) { }
306 0 4 if not defined $ref and $cldr->error
307 3 0 if ($ref and defined $ref->{'collations'} and ref $ref->{'collations'} eq "ARRAY" and scalar @{$ref->{'collations'};})
324 1 2 if (my $hc = $self->hour_cycle)
331 2 0 unless ($ref)
334 0 2 unless ($cc)
340 0 2 unless $cc
342 0 2 if not defined $all and $cldr->error
343 2 0 if $all and ref $all eq "ARRAY"
345 2 0 if ($ref and exists $ref->{'time_format'} and $ref->{'time_format'})
356 0 2 unless $map->{$_}
366 0 2 if (my $nu = $self->number)
380 0 3 if not defined $ref and $cldr->error
381 2 1 if ($ref and length($ref->{'number_system'} // ""))
389 2 0 if defined $num_sys
407 0 3 if not defined $ref and $cldr->error
408 2 1 if ($ref and length($ref->{'value'} // ""))
420 2 0 if (defined $orientation)
422 0 2 unless exists $map->{$orientation}
433 1 3 unless ($cc)
439 4 0 if ($cc) { }
458 2 2 unless ($cc = $self->country_code)
468 4 0 if (length($info->{'first_day'} // '')) { }
475 0 0 unless defined $fallback
476 0 0 if $fallback
479 1 3 if (length($info->{'min_days'} // '')) { }
486 3 0 unless defined $fallback
487 3 0 if $fallback
491 1 3 if (length($info->{'weekend'} // '')) { }
498 1 2 unless defined $fallback
499 3 0 if $fallback
509 2 5 if (my $hc = $self->hour_cycle)
514 0 5 if (want("OBJECT"))
524 196 98 if (@_)
527 1 195 if (not defined $val) { }
195 0 elsif (length $val == 2) { }
541 292 2 if (my $loc = $self->SUPER::language || $self->SUPER::language3)
545 0 2 if (want("OBJECT"))
565 19 0 if ($ref and $ref->{'target'})
572 19 0 if (defined $full) { }
576 19 0 if (my $locale = $new->locale) { }
0 0 elsif (my $locale3 = $new->locale3) { }
585 19 0 if (my $script = $new->script)
590 19 0 if (my $cc = $new->country_code) { }
0 0 elsif (my $code = $new->region) { }
599 0 19 if (my $variant = $new->variant)
628 1 6 unless (defined $locale and length $locale)
635 0 1 if ($core eq $locale3)
648 0 7 if (defined $locale and length $locale and $core eq $locale)
661 7 0 if ($test_locale) { }
679 7 0 if ($cc) { }
0 0 elsif ($test_cc) { }
681 1 6 if ($cc ne $test_cc)
690 7 0 if ($script)
694 7 0 if ($info and exists $info->{'scripts'} and ref($info->{'scripts'} // '') eq 'ARRAY' and scalar @{$info->{'scripts'};}) { }
707 1 6 if ($script ne $lang_scripts->[0])
718 2 2 if (my $num = $self->number)
723 0 2 if (want("OBJECT"))
733 2 3 if (defined(my $bool = $self->colNumeric))
735 1 1 $bool ? :
738 0 3 if (want("OBJECT"))
752 0 0 if (scalar @_)
756 0 0 if (scalar @_ == 1 and ref $_[0] eq 'HASH') { }
762 0 0 if (scalar @_ > 1 and ref $_[-1] eq "HASH")
769 0 0 if not defined $err and exists $opts->{'error'} and defined $opts->{'error'} and length $opts->{'error'}
771 0 0 if exists $opts->{'class'} and defined $opts->{'class'} and length $opts->{'class'}
772 0 0 if exists $opts->{'code'} and defined $opts->{'code'} and length $opts->{'code'}
777 0 0 if (not defined $err and !scalar(@_) || defined $class) { }
0 0 elsif (defined $err and builtin::blessed($err) and scalar @_ == 1 || scalar @_ == 2 && defined $class) { }
780 0 0 length ${$pack . '::ERROR';} ? :
0 0 ref $self ? :
781 0 0 if (not defined $error) { }
787 0 0 defined $class ? :
788 0 0 if defined $code
797 0 0 defined $class ? :
798 0 0 if defined $code and $self->{'error'}->can("code")
800 0 0 if ($self->{'fatal'} or defined ${"${class}::FATAL_EXCEPTIONS";} and ${"${class}::FATAL_EXCEPTIONS";})
811 0 0 if (want("OBJECT"))
822 3 64 if (@_)
826 3 61 if (my $rg = $self->country_code || $self->SUPER::region)
831 0 61 if (want("OBJECT"))
842 82 129 if (@_)
847 66 63 if (my $script = $self->SUPER::script)
852 0 63 if (want("OBJECT"))
865 48 3 if (ref $self) { }
902 0 0 if (scalar @_ == 1) { }
904 0 0 if ((ref $_[0] || '') eq 'HASH') { }
0 0 elsif (ref $_[0] and $_[0]->isa('Locale::Intl::Exception')) { }
907 0 0 if ($args->{'skip_frames'})
915 0 0 if exists $args->{$k}
933 0 0 ref $_ eq 'CODE' ? :
944 0 0 if $self->{'_cache_value'} and not length $self->{'_reset'}
973 0 0 if (defined $file and defined $line)
986 0 0 if (not length $self->{'_reset'} and scalar @_)
996 0 0 unless ref $self
1006 0 0 if (@_) { }
1027 0 0 if @_
1039 0 0 if $serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
1053 0 0 scalar @args == 1 && ref $args[0] eq 'ARRAY' ? :
1054 0 0 defined $ref && ref $ref eq 'ARRAY' && scalar @$ref > 1 ? :
1055 0 0 ref $ref eq 'ARRAY' ? :
1058 0 0 if (ref $self) { }
1095 0 0 $_[1] ? :
1108 0 0 if $serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
1123 0 0 if (scalar @args == 1 and ref $args[0] eq 'ARRAY') { }
1133 0 0 if (ref $self) { }
1149 0 0 $_[0] ? :
1172 0 0 @_ ? :
1180 0 0 if (want("OBJECT"))