Branch Coverage

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


line true false branch
205 2 2 $self->_national_prefix_optional_when_formatting ? :
259 1 2 $self->extension ? :
313 1 3 $self->extension ? :
333 1 9 $self->extension ? :
355 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) { }
398 4 3 if ($from_country eq $self->country) { }
432 4 4 if ($from_country eq $self->country) { }
457 4 13 if ($raw_num =~ /^\s*\+/u) { }
13 0 elsif (my $country = $self->country) { }
464 13 0 if (defined $national_prefix)
472 0 17 unless ($country)
479 17 0 if ($Number::MuPhone::MUPHONE_DATA->{'territories'}{$country}{'generalDesc'} and $Number::MuPhone::MUPHONE_DATA->{'territories'}{$country}{'generalDesc'}{'nationalNumberPattern'})
483 3 14 unless ($cleaned_num =~ /$regex/u)
490 0 14 unless ($self->_cleaned_number =~ $self->_national_number_regex)
495 0 14 if $self->error
507 49 0 if (my $leading_digits = $format_hash->{'leadingDigits'})
508 35 14 unless $num =~ /^(?:$leading_digits)/u
512 0 14 unless $num =~ /$pattern/u
520 0 14 if ($@)
526 6 8 $format_hash->{'nationalPrefixOptionalWhenFormatting'} ? :
547 4 2 if ($countries = $Number::MuPhone::MUPHONE_DATA->{'idd_codes'}{$idd})
564 58 0 $Number::MuPhone::MUPHONE_DATA->{'territories'}{$country}{'generalDesc'} && $Number::MuPhone::MUPHONE_DATA->{'territories'}{$country}{'generalDesc'}{'nationalNumberPattern'} ? :
566 0 58 unless $national_number_format_regex
569 52 6 unless $num =~ /$national_number_format_regex/u