git.iko.soy/typeable/libphonenumber
on main help sign in
3 files changed+24−24
since splitsnapshots
unifiedsplit
.github/workflows/ci.yaml+10−7 libphonenumber.cabal+11−8 test/Spec.hs+3−9
.github/workflows/ci.yaml+10−7
@@ -24,14 +24,17 @@ jobs:
2424 - "9.0.2"
2525 - "9.2.8"
2626 - "9.4.8"
27− - "9.6.3"
28− - "9.8.1"
27+ - "9.6.7"
28+ - "9.8.4"
29+ - "9.10.3"
30+ - "9.12.2"
31+ - "9.14.1"
2932 fail-fast: false
3033 name: Build on Linux, GHC ${{ matrix.ghc_version }}
3134 runs-on: ${{ matrix.platform }}
3235 steps:
33− - uses: actions/checkout@v3
34− - uses: haskell/actions/setup@v2
36+ - uses: actions/checkout@v4
37+ - uses: haskell-actions/setup@v2
3538 with:
3639 ghc-version: ${{ matrix.ghc_version }}
3740 cabal-version: "3.10.1.0"
@@ -67,7 +70,7 @@ jobs:
6770 if: github.event_name == 'release'
6871 steps:
6972 - uses: actions/checkout@v3
70− - uses: haskell/actions/setup@v2
73+ - uses: haskell-actions/setup@v2
7174 with:
7275 cabal-version: "3.10.1.0"
7376 - name: Install C++ library
@@ -82,11 +85,11 @@ jobs:
8285 run: |
8386 cabal haddock --builddir "$GITHUB_WORKSPACE/doc" --haddock-for-hackage --enable-doc
8487 echo "docs=$(find "$GITHUB_WORKSPACE/doc" -maxdepth 1 -type f -name '*-docs.tar.gz')" >> "$GITHUB_ENV"
85− - uses: actions/upload-artifact@v2
88+ - uses: actions/upload-artifact@v6
8689 with:
8790 name: Source tarball
8891 path: ${{ env.dist }}
89− - uses: svenstaro/upload-release-action@2.2.1
92+ - uses: svenstaro/upload-release-action@2.11.3
9093 with:
9194 repo_token: ${{ secrets.GITHUB_TOKEN }}
9295 file: ${{ env.dist }}
libphonenumber.cabal+11−8
@@ -1,6 +1,6 @@
11cabal-version: 3.0
22name: libphonenumber
3−version: 0.1.3.0
3+version: 0.1.4.0
44category: Data
55synopsis: Parsing, formatting, and validating international phone
66 numbers
@@ -25,7 +25,7 @@ description:
2525 and to avoid a dependency on @text@, we use 'ByteString'
2626 throughout the library instead of 'Data.Text.Text'.
2727
28−copyright: 2023 Typeable
28+copyright: 2023-2025 Typeable
2929author: Typeable
3030maintainer: mniip@typeable.io
3131homepage: https://github.com/typeable/libphonenumber/
@@ -39,8 +39,11 @@ tested-with:
3939 , GHC == 9.0.2
4040 , GHC == 9.2.8
4141 , GHC == 9.4.8
42− , GHC == 9.6.3
43− , GHC == 9.8.1
42+ , GHC == 9.6.7
43+ , GHC == 9.8.4
44+ , GHC == 9.10.3
45+ , GHC == 9.12.2
46+ , GHC == 9.14.1
4447
4548build-type: Simple
4649
@@ -61,12 +64,13 @@ library
6164 , Data.PhoneNumber.Internal.Number
6265 , Data.PhoneNumber.Internal.Util
6366 build-depends:
64− , base >= 4.12 && < 4.20
67+ , base >= 4.12 && < 4.23
6568 , bytestring >= 0.10.8 && < 0.13
66− , containers >= 0.6.0 && < 0.8
69+ , containers >= 0.6.0 && < 0.9
6770 , deepseq >= 1.4.4 && < 1.6
6871 , transformers >= 0.5.5 && < 0.7
6972 build-tool-depends: c2hs:c2hs
73+ pkgconfig-depends: protobuf
7074 include-dirs: include
7175 includes:
7276 , c_phonenumber.h
@@ -76,7 +80,6 @@ library
7680 , cxxbits/c_phonenumberutil.cpp
7781 extra-libraries:
7882 , phonenumber
79− , protobuf
8083 if impl(ghc >= 9.4)
8184 build-depends: system-cxx-std-lib
8285 else
@@ -108,7 +111,7 @@ test-suite spec_test
108111 , containers
109112 , hspec >= 2.10.8 && < 2.12
110113 , libphonenumber
111− , QuickCheck >= 2.13.1 && < 2.15
114+ , QuickCheck >= 2.13.1 && < 2.16
112115 main-is: Spec.hs
113116 hs-source-dirs: test
114117 default-language: Haskell2010
test/Spec.hs+3−9
@@ -125,15 +125,9 @@ 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 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 ==>
128+ prop "concatenated with country code parses to the original (if valid)" $
129+ \(ParsedNumber _ pn) ->
130+ isValidNumber Nothing pn ==>
137131 let
138132 cc = countryCode pn
139133 nsn = nationalSignificantNumber pn