From a912543915ab59550518f4409abc294d87ee0627 Mon Sep 17 00:00:00 2001 From: Cevado Date: Fri, 21 Apr 2017 20:08:38 -0300 Subject: [PATCH] Better benchmarks --- bench/phone_bench.exs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bench/phone_bench.exs b/bench/phone_bench.exs index d8daddc..8065349 100644 --- a/bench/phone_bench.exs +++ b/bench/phone_bench.exs @@ -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