Branch Coverage

lib/Number/MuPhone.pm
Criterion Covered Total %
branch 39 52 75.0


line true false branch
253 2 2 $self->_national_prefix_optional_when_formatting ? :
307 1 2 $self->extension ? :
361 1 3 $self->extension ? :
381 1 9 $self->extension ? :
403 8 7 if (ref $str_or_obj eq 'Number::MuPhone') { }
0 7 elsif ($str_or_obj =~ /^\s\+/u) { }
7 0 elsif ($str_or_obj =~ /^[A-Z]{2}$/u) { }
446 4 3 if ($from_country eq $self->country) { }
480 4 4 if ($from_country eq $self->country) { }
505 4 13 if ($raw_num =~ /^\s*\+/u) { }
13 0 elsif (my $country = $self->country) { }
512 13 0 if (defined $national_prefix)
520 0 17 unless ($country)
527 17 0 if ($Number::MuPhone::MUPHONE_DATA->{'territories'}{$country}{'generalDesc'} and $Number::MuPhone::MUPHONE_DATA->{'territories'}{$country}{'generalDesc'}{'nationalNumberPattern'})
531 3 14 unless ($cleaned_num =~ /$regex/u)
538 0 14 unless ($self->_cleaned_number =~ $self->_national_number_regex)
543 0 14 if $self->error
555 49 0 if (my $leading_digits = $format_hash->{'leadingDigits'})
556 35 14 unless $num =~ /^(?:$leading_digits)/u
560 0 14 unless $num =~ /$pattern/u
566 0 14 if ($@)
572 6 8 $format_hash->{'nationalPrefixOptionalWhenFormatting'} ? :
593 4 2 if ($countries = $Number::MuPhone::MUPHONE_DATA->{'idd_codes'}{$idd})
610 58 0 $Number::MuPhone::MUPHONE_DATA->{'territories'}{$country}{'generalDesc'} && $Number::MuPhone::MUPHONE_DATA->{'territories'}{$country}{'generalDesc'}{'nationalNumberPattern'} ? :
612 0 58 unless $national_number_format_regex
615 52 6 unless $num =~ /$national_number_format_regex/u