git.iko.soy/typeable/libphonenumber
on 08c9b54 help sign in
3 files changed+21−17
since splitsnapshots
unifiedsplit
.github/workflows/ci.yaml+5−6 libphonenumber.cabal+7−8 test/Spec.hs+9−3
.github/workflows/ci.yaml+5−6
@@ -24,11 +24,10 @@ jobs:
2424 - "9.0.2"
2525 - "9.2.8"
2626 - "9.4.8"
27− - "9.6.7"
27+ - "9.6.6"
2828 - "9.8.4"
29− - "9.10.3"
30− - "9.12.2"
31− - "9.14.1"
29+ - "9.10.1"
30+ - "9.12.1"
3231 fail-fast: false
3332 name: Build on Linux, GHC ${{ matrix.ghc_version }}
3433 runs-on: ${{ matrix.platform }}
@@ -85,11 +84,11 @@ jobs:
8584 run: |
8685 cabal haddock --builddir "$GITHUB_WORKSPACE/doc" --haddock-for-hackage --enable-doc
8786 echo "docs=$(find "$GITHUB_WORKSPACE/doc" -maxdepth 1 -type f -name '*-docs.tar.gz')" >> "$GITHUB_ENV"
88− - uses: actions/upload-artifact@v6
87+ - uses: actions/upload-artifact@v2
8988 with:
9089 name: Source tarball
9190 path: ${{ env.dist }}
92− - uses: svenstaro/upload-release-action@2.11.3
91+ - uses: svenstaro/upload-release-action@2.2.1
9392 with:
9493 repo_token: ${{ secrets.GITHUB_TOKEN }}
9594 file: ${{ env.dist }}
libphonenumber.cabal+7−8
@@ -1,6 +1,6 @@
11cabal-version: 3.0
22name: libphonenumber
3−version: 0.1.4.0
3+version: 0.1.3.0
44category: Data
55synopsis: Parsing, formatting, and validating international phone
66 numbers
@@ -39,11 +39,10 @@ tested-with:
3939 , GHC == 9.0.2
4040 , GHC == 9.2.8
4141 , GHC == 9.4.8
42− , GHC == 9.6.7
42+ , GHC == 9.6.6
4343 , GHC == 9.8.4
44− , GHC == 9.10.3
45− , GHC == 9.12.2
46− , GHC == 9.14.1
44+ , GHC == 9.10.1
45+ , GHC == 9.12.1
4746
4847build-type: Simple
4948
@@ -64,13 +63,12 @@ library
6463 , Data.PhoneNumber.Internal.Number
6564 , Data.PhoneNumber.Internal.Util
6665 build-depends:
67− , base >= 4.12 && < 4.23
66+ , base >= 4.12 && < 4.22
6867 , bytestring >= 0.10.8 && < 0.13
69− , containers >= 0.6.0 && < 0.9
68+ , containers >= 0.6.0 && < 0.8
7069 , deepseq >= 1.4.4 && < 1.6
7170 , transformers >= 0.5.5 && < 0.7
7271 build-tool-depends: c2hs:c2hs
73− pkgconfig-depends: protobuf
7472 include-dirs: include
7573 includes:
7674 , c_phonenumber.h
@@ -80,6 +78,7 @@ library
8078 , cxxbits/c_phonenumberutil.cpp
8179 extra-libraries:
8280 , phonenumber
81+ , protobuf
8382 if impl(ghc >= 9.4)
8483 build-depends: system-cxx-std-lib
8584 else
test/Spec.hs+9−3
@@ -125,9 +125,15 @@ main = hspec $ modifyMaxSuccess (* 10) $ do
125125 prop "returns only ASCII digits" $ \(ParsedNumber _ pn) ->
126126 BSC.all (`elem` ['0'..'9']) $ nationalSignificantNumber pn
127127 modifyMaxDiscardRatio (* 10) $ do
128− prop "concatenated with country code parses to the original (if valid)" $
129− \(ParsedNumber _ pn) ->
130− isValidNumber Nothing pn ==>
128+ prop "concatenated with country code parses to the original (if valid and not MX)" $
129+ \(ParsedNumber (_, mReg, ParserInput input) pn) ->
130+ -- Apparently "+52112210000000" makes the parser/formatter do weird
131+ -- stuff as it tries to handle the deprecated (?) mobile token ("1"
132+ -- after "+52")
133+ if "5211" `BS.isPrefixOf` normalizeNumber Digits input ||
134+ mReg == Just "MX" && "11" `BS.isPrefixOf` normalizeNumber Digits input
135+ then discard
136+ else isValidNumber Nothing pn ==>
131137 let
132138 cc = countryCode pn
133139 nsn = nationalSignificantNumber pn