on master help sign in
Test with 3 latest versions of GHC, update Ormolu
commit2e5974f5f8b6506f7ba4664ea84b26cca3d364c4 authorMark Karpov <markkarpov92@gmail.com> dateSat 4 Dec 2021, 13:57 (5 years ago) parent455e62b
5 files changed+13−10
.github/workflows/ci.yaml+1−1 Network/HTTP/Req.hs+1−1 httpbin-tests/Network/HTTP/ReqSpec.hs+2−1 pure-tests/Network/HTTP/ReqSpec.hs+6−4 req.cabal+3−3
.github/workflows/ci.yaml+1−1
@@ -19,7 +19,7 @@ jobs:
1919 strategy:
2020 matrix:
2121 cabal: ["3.6"]
22− ghc: ["8.8.4", "8.10.7", "9.0.2"]
22+ ghc: ["8.10.7", "9.0.2", "9.2.1"]
2323 env:
2424 CONFIG: "--enable-tests --enable-benchmarks --flags=dev"
2525 steps:
Network/HTTP/Req.hs+1−1
@@ -251,7 +251,7 @@ import Data.List.NonEmpty (NonEmpty (..))
251251import qualified Data.List.NonEmpty as NE
252252import Data.Maybe (fromMaybe)
253253import Data.Proxy
254−import Data.Semigroup hiding (Option, option)
254+import Data.Semigroup (Endo (..))
255255import Data.Text (Text)
256256import qualified Data.Text as T
257257import qualified Data.Text.Encoding as T
httpbin-tests/Network/HTTP/ReqSpec.hs+2−1
@@ -16,6 +16,7 @@ import qualified Data.Aeson.KeyMap as Aeson.KeyMap
1616import qualified Data.ByteString as B
1717import qualified Data.ByteString.Lazy as BL
1818import Data.Functor.Identity (runIdentity)
19+import Data.Maybe (fromJust)
1920import Data.Proxy
2021import Data.Text (Text)
2122import qualified Data.Text as T
@@ -135,7 +136,7 @@ spec = do
135136 LM.partBS "bar" "bar data!"
136137 ]
137138 r <- req POST (httpbin /: "post") body jsonResponse mempty
138− let Just contentType = getRequestContentType body
139+ let contentType = fromJust (getRequestContentType body)
139140 (stripFunnyHeaders . stripOrigin) (responseBody r)
140141 `shouldBe` object
141142 [ "args" .= emptyObject,
pure-tests/Network/HTTP/ReqSpec.hs+6−4
@@ -159,11 +159,13 @@ spec = do
159159 let uriHttp = uri' {URI.uriScheme = Just [QQ.scheme|http|]}
160160 uriHttps = uri' {URI.uriScheme = Just [QQ.scheme|https|]}
161161 requestHttp <-
162− let Left (url', options) = fromJust (useURI uriHttp)
163− in req_ GET url' NoReqBody options
162+ case fromJust (useURI uriHttp) of
163+ Left (url', options) -> req_ GET url' NoReqBody options
164+ _ -> error "(useURI uriHttp) should have returned Left"
164165 requestHttps <-
165− let Right (url', options) = fromJust (useURI uriHttps)
166− in req_ GET url' NoReqBody options
166+ case fromJust (useURI uriHttps) of
167+ Right (url', options) -> req_ GET url' NoReqBody options
168+ _ -> error "(useURI uriHttps) should have returned Right"
167169 L.host requestHttp `shouldBe` uriHost uriHttp
168170 L.host requestHttps `shouldBe` uriHost uriHttps
169171 L.port requestHttp `shouldBe` uriPort 80 uriHttp
req.cabal+3−3
@@ -5,7 +5,7 @@ license: BSD-3-Clause
55license-file: LICENSE.md
66maintainer: Mark Karpov <markkarpov92@gmail.com>
77author: Mark Karpov <markkarpov92@gmail.com>
8−tested-with: ghc ==8.8.4 ghc ==8.10.7 ghc ==9.0.2
8+tested-with: ghc ==8.10.7 ghc ==9.0.2 ghc ==9.2.1
99homepage: https://github.com/mrkkrp/req
1010bug-reports: https://github.com/mrkkrp/req/issues
1111synopsis: HTTP client library
@@ -49,7 +49,7 @@ library
4949 monad-control >=1.0 && <1.1,
5050 mtl >=2.0 && <3.0,
5151 retry >=0.8 && <0.10,
52− template-haskell >=2.14 && <2.18,
52+ template-haskell >=2.14 && <2.19,
5353 text >=0.2 && <1.3,
5454 time >=1.2 && <1.13,
5555 transformers >=0.5.3.0 && <0.6,
@@ -89,7 +89,7 @@ test-suite pure-tests
8989 mtl >=2.0 && <3.0,
9090 req,
9191 retry >=0.8 && <0.10,
92− template-haskell >=2.14 && <2.18,
92+ template-haskell >=2.14 && <2.19,
9393 text >=0.2 && <1.3,
9494 time >=1.2 && <1.13
9595