git.iko.soy/typeable/libphonenumber
on main help sign in
Tweak tests
commit26de9d5b53c15b36e954a72655fc888cb5b39782 authormniip <mniip@mniip.com> dateTue 21 Mar 2023, 18:10 (4 years ago) parente7e6ffb
1 file changed+8−3
test/Spec.hs+8−3
test/Spec.hs+8−3
@@ -146,10 +146,15 @@ main = hspec $ modifyMaxSuccess (* 10) $ do
146146 BSC.all (`elem` ['0'..'9']) $ countryMobileToken cc
147147
148148 describe "formatNumber" $ do
149− prop "with International produces a parseable result" $
149+ prop "with International produces a parseable result (if no ext)" $
150150 \(ParsedNumber _ pn) -> possibleNumber Unknown pn == IsPossible ==>
151− isRight $ parseNumber Canonicalize Nothing
152− $ formatNumber International pn
151+ -- Apparently in the TW region an extension number is formatted
152+ -- with a "#", and the formatter will format
153+ -- "+886 2 2123 4567 ext. 1234567890" as "+886 2 2123 4567#1234567890"
154+ -- even though the former parses and the latter doesn't
155+ extension pn == Nothing ==>
156+ isRight $ parseNumber Canonicalize Nothing
157+ $ formatNumber International pn
153158 prop "with E164 produces a parseable result" $
154159 \(ParsedNumber _ pn) -> possibleNumber Unknown pn == IsPossible ==>
155160 isRight $ parseNumber Canonicalize Nothing