git.iko.soy/typeable/libphonenumber
on 08c9b54 help sign in
.github/workflows/ci.yaml+5−6
since splitsnapshots
unifiedsplit
@@ -24,11 +24,10 @@ jobs:
24 - "9.0.2"
24 - "9.0.2"
25 - "9.2.8"
25 - "9.2.8"
26 - "9.4.8"
26 - "9.4.8"
27− - "9.6.7"
27+ - "9.6.6"
28 - "9.8.4"
28 - "9.8.4"
29− - "9.10.3"
29+ - "9.10.1"
30− - "9.12.2"
30+ - "9.12.1"
31− - "9.14.1"
32 fail-fast: false
31 fail-fast: false
33 name: Build on Linux, GHC ${{ matrix.ghc_version }}
32 name: Build on Linux, GHC ${{ matrix.ghc_version }}
34 runs-on: ${{ matrix.platform }}
33 runs-on: ${{ matrix.platform }}
@@ -85,11 +84,11 @@ jobs:
85 run: |
84 run: |
86 cabal haddock --builddir "$GITHUB_WORKSPACE/doc" --haddock-for-hackage --enable-doc
85 cabal haddock --builddir "$GITHUB_WORKSPACE/doc" --haddock-for-hackage --enable-doc
87 echo "docs=$(find "$GITHUB_WORKSPACE/doc" -maxdepth 1 -type f -name '*-docs.tar.gz')" >> "$GITHUB_ENV"
86 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
89 with:
88 with:
90 name: Source tarball
89 name: Source tarball
91 path: ${{ env.dist }}
90 path: ${{ env.dist }}
92− - uses: svenstaro/upload-release-action@2.11.3
91+ - uses: svenstaro/upload-release-action@2.2.1
93 with:
92 with:
94 repo_token: ${{ secrets.GITHUB_TOKEN }}
93 repo_token: ${{ secrets.GITHUB_TOKEN }}
95 file: ${{ env.dist }}
94 file: ${{ env.dist }}
libphonenumber.cabal+7−8
@@ -1,6 +1,6 @@
1cabal-version: 3.0
1cabal-version: 3.0
2name: libphonenumber
2name: libphonenumber
3−version: 0.1.4.0
3+version: 0.1.3.0
4category: Data
4category: Data
5synopsis: Parsing, formatting, and validating international phone
5synopsis: Parsing, formatting, and validating international phone
6 numbers
6 numbers
@@ -39,11 +39,10 @@ tested-with:
39 , GHC == 9.0.2
39 , GHC == 9.0.2
40 , GHC == 9.2.8
40 , GHC == 9.2.8
41 , GHC == 9.4.8
41 , GHC == 9.4.8
42− , GHC == 9.6.7
42+ , GHC == 9.6.6
43 , GHC == 9.8.4
43 , GHC == 9.8.4
44− , GHC == 9.10.3
44+ , GHC == 9.10.1
45− , GHC == 9.12.2
45+ , GHC == 9.12.1
46− , GHC == 9.14.1
47
46
48build-type: Simple
47build-type: Simple
49
48
@@ -64,13 +63,12 @@ library
64 , Data.PhoneNumber.Internal.Number
63 , Data.PhoneNumber.Internal.Number
65 , Data.PhoneNumber.Internal.Util
64 , Data.PhoneNumber.Internal.Util
66 build-depends:
65 build-depends:
67− , base >= 4.12 && < 4.23
66+ , base >= 4.12 && < 4.22
68 , bytestring >= 0.10.8 && < 0.13
67 , bytestring >= 0.10.8 && < 0.13
69− , containers >= 0.6.0 && < 0.9
68+ , containers >= 0.6.0 && < 0.8
70 , deepseq >= 1.4.4 && < 1.6
69 , deepseq >= 1.4.4 && < 1.6
71 , transformers >= 0.5.5 && < 0.7
70 , transformers >= 0.5.5 && < 0.7
72 build-tool-depends: c2hs:c2hs
71 build-tool-depends: c2hs:c2hs
73− pkgconfig-depends: protobuf
74 include-dirs: include
72 include-dirs: include
75 includes:
73 includes:
76 , c_phonenumber.h
74 , c_phonenumber.h
@@ -80,6 +78,7 @@ library
80 , cxxbits/c_phonenumberutil.cpp
78 , cxxbits/c_phonenumberutil.cpp
81 extra-libraries:
79 extra-libraries:
82 , phonenumber
80 , phonenumber
81+ , protobuf
83 if impl(ghc >= 9.4)
82 if impl(ghc >= 9.4)
84 build-depends: system-cxx-std-lib
83 build-depends: system-cxx-std-lib
85 else
84 else
test/Spec.hs+9−3
@@ -125,9 +125,15 @@ main = hspec $ modifyMaxSuccess (* 10) $ do
125 prop "returns only ASCII digits" $ \(ParsedNumber _ pn) ->
125 prop "returns only ASCII digits" $ \(ParsedNumber _ pn) ->
126 BSC.all (`elem` ['0'..'9']) $ nationalSignificantNumber pn
126 BSC.all (`elem` ['0'..'9']) $ nationalSignificantNumber pn
127 modifyMaxDiscardRatio (* 10) $ do
127 modifyMaxDiscardRatio (* 10) $ do
128− prop "concatenated with country code parses to the original (if valid)" $
128+ prop "concatenated with country code parses to the original (if valid and not MX)" $
129− \(ParsedNumber _ pn) ->
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
130− isValidNumber Nothing pn ==>
136+ else isValidNumber Nothing pn ==>
131 let
137 let
132 cc = countryCode pn
138 cc = countryCode pn
133 nsn = nationalSignificantNumber pn
139 nsn = nationalSignificantNumber pn