Skip to content

Commit

Permalink
Merge pull request #107 from fcevado/angola_numbers
Browse files Browse the repository at this point in the history
Correct Angola numbers parsing
  • Loading branch information
fcevado committed Sep 5, 2017
2 parents c6a66c6 + bff7a59 commit 61e203b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/phone/ao.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Phone.AO do

use Helper.Country

def regex, do: ~r/^(244)()(9)/
def regex, do: ~r/^(244)()(.{9})/
def country, do: "Angola"
def a2, do: "AO"
def a3, do: "AGO"
Expand Down
4 changes: 2 additions & 2 deletions test/phone/a_countries/ao_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ defmodule Phone.AOTest do
Enum.map(main_module.codes,
fn code ->
test "#{inspect main_module} parses area code #{code}" do
assert Phone.valid?(unquote("#{code}9"))
assert {:ok, parsed} = Phone.parse(unquote("#{code}9"))
assert Phone.valid?(unquote("#{code}555555555"))
assert {:ok, parsed} = Phone.parse(unquote("#{code}555555555"))

assert parsed.country == unquote(main_module).country
assert parsed.a2 == unquote(main_module).a2
Expand Down

0 comments on commit 61e203b

Please sign in to comment.