Skip to content

Commit

Permalink
Merge pull request #95 from fcevado/better_bench
Browse files Browse the repository at this point in the history
Better benchmarks
  • Loading branch information
fcevado committed Apr 21, 2017
2 parents 1cf117d + a912543 commit 86d926d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bench/phone_bench.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@ defmodule PhoneBench do
{:ok, _result} = Phone.parse(@nanp_phone_number)
end

bench "Phone.parse/1 with an NANP phone number error" do
{:error, _result} = Phone.parse("1253630123")
end

bench "Phone.parse/1 with an Andorra phone number" do
{:ok, _result} = Phone.parse(@andorra_phone_number)
end

bench "Phone.parse/1 with an Andorra phone number error" do
{:error, _result} = Phone.parse("37612345")
end

bench "Phone.parse/1 with a Zimbabwe phone number" do
{:ok, _result} = Phone.parse(@zimbabwe_phone_number)
end

bench "Phone.parse/1 with a Zimbabwe phone number error" do
{:error, _result} = Phone.parse("263")
end
end

0 comments on commit 86d926d

Please sign in to comment.