git.iko.soy/servant-quickcheck
on master help sign in
Looser bounds.

Support recent versions of QuickCheck, aeson, http-client, servant, servant-client, and servant-server.

commit8eb5c334c1bbdef2cbd71d376296cec43fe347d7 authorJulian K. Arni <jkarni@gmail.com> dateMon 3 Oct 2016, 16:30 (10 years ago) parentf36f544
5 files changed+27−14
servant-quickcheck.cabal+7−7 src/Servant/QuickCheck/Internal/HasGenRequest.hs+2−3 src/Servant/QuickCheck/Internal/QuickCheck.hs+5 stack-ghc-8.0.1.yaml+4−4 test/Servant/QuickCheck/InternalSpec.hs+9
servant-quickcheck.cabal+7−7
@@ -33,26 +33,26 @@ library
3333 , Servant.QuickCheck.Internal.ErrorTypes
3434 build-depends: base >=4.8 && <4.10
3535 , base-compat == 0.9.*
36− , aeson > 0.8 && < 0.12
36+ , aeson > 0.8 && < 2
3737 , bytestring == 0.10.*
3838 , case-insensitive == 1.2.*
3939 , data-default-class >= 0.0 && < 0.2
4040 , hspec == 2.2.*
41− , http-client >= 0.4.30 && < 0.5
41+ , http-client >= 0.4.30 && < 0.6
4242 , http-media == 0.6.*
4343 , http-types > 0.8 && < 0.10
4444 , mtl > 2.1 && < 2.3
4545 , pretty == 1.1.*
4646 , process >= 1.2 && < 1.5
47− , QuickCheck > 2.7 && < 2.9
48− , servant > 0.6 && < 0.9
49− , servant-client > 0.6 && < 0.9
50− , servant-server > 0.6 && < 0.9
47+ , QuickCheck > 2.7 && < 2.10
48+ , servant > 0.6 && < 0.10
49+ , servant-client > 0.6 && < 0.10
50+ , servant-server > 0.6 && < 0.10
5151 , split == 0.2.*
5252 , string-conversions > 0.3 && < 0.5
5353 , temporary == 1.2.*
5454 , text == 1.*
55− , time == 1.5.*
55+ , time >= 1.5 && < 1.7
5656 , warp >= 3.2.4 && < 3.3
5757
5858 hs-source-dirs: src
src/Servant/QuickCheck/Internal/HasGenRequest.hs+2−3
@@ -2,7 +2,6 @@
22{-# LANGUAGE PolyKinds #-}
33module Servant.QuickCheck.Internal.HasGenRequest where
44
5−import Data.Default.Class (def)
65import Data.Monoid ((<>))
76import Data.String (fromString)
87import Data.String.Conversions (cs)
@@ -10,7 +9,7 @@ import qualified Data.ByteString as BS
109import GHC.TypeLits (KnownSymbol, Nat, symbolVal)
1110import Network.HTTP.Client (Request, RequestBody (..), host, method, path,
1211 port, queryString, requestBody, requestHeaders,
13− secure)
12+ secure, defaultRequest)
1413import Network.HTTP.Media (renderHeader)
1514import Prelude.Compat
1615import Servant
@@ -125,7 +124,7 @@ instance (KnownSymbol x, HasGenRequest b)
125124
126125instance (ReflectMethod method)
127126 => HasGenRequest (Verb (method :: k) (status :: Nat) (cts :: [*]) a) where
128− genRequest _ = return $ \burl -> def
127+ genRequest _ = return $ \burl -> defaultRequest
129128 { host = cs $ baseUrlHost burl
130129 , port = baseUrlPort burl
131130 , secure = baseUrlScheme burl == Https
src/Servant/QuickCheck/Internal/QuickCheck.hs+5
@@ -1,4 +1,5 @@
11{-# LANGUAGE RecordWildCards #-}
2+{-# LANGUAGE CPP #-}
23module Servant.QuickCheck.Internal.QuickCheck where
34
45import Control.Concurrent (modifyMVar_, newMVar, readMVar)
@@ -144,7 +145,11 @@ serverDoesntSatisfy api burl args preds = do
144145 InsufficientCoverage {} -> expectationFailure $ "Insufficient coverage"
145146
146147noCheckStatus :: C.Request -> C.Request
148+#if MIN_VERSION_http_client(0,5,0)
149+noCheckStatus = id
150+#else
147151noCheckStatus r = r { C.checkStatus = \_ _ _ -> Nothing}
152+#endif
148153
149154defManager :: C.Manager
150155defManager = unsafePerformIO $ C.newManager C.defaultManagerSettings
stack-ghc-8.0.1.yaml+4−4
@@ -1,10 +1,10 @@
11# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
2−resolver: nightly-2016-09-07
2+resolver: nightly-2016-10-03
33packages:
44- '.'
55extra-deps:
6−- 'servant-0.8.1'
7−- 'servant-server-0.8.1'
8−- 'servant-client-0.8.1'
6+- 'servant-0.9'
7+- 'servant-server-0.9'
8+- 'servant-client-0.9'
99flags: {}
1010extra-package-dbs: []
test/Servant/QuickCheck/InternalSpec.hs+9
@@ -5,7 +5,11 @@ import Control.Concurrent.MVar (newMVar, readMVar, swapMVar)
55import Control.Monad.IO.Class (liftIO)
66import Prelude.Compat
77import Servant
8+#if MIN_VERSION_servant(0,8,0)
89import Servant.API.Internal.Test.ComprehensiveAPI (comprehensiveAPIWithoutRaw)
10+#else
11+import Servant.API.Internal.Test.ComprehensiveAPI (comprehensiveAPI, ComprehensiveAPI)
12+#endif
913import Test.Hspec (Spec, context, describe, it,
1014 shouldBe, shouldContain)
1115import Test.Hspec.Core.Spec (Arg, Example, Result (..),
@@ -135,3 +139,8 @@ noOfTestCases = 20000
135139#else
136140noOfTestCases = 1000
137141#endif
142+
143+#if !MIN_VERSION_servant(0,8,0)
144+comprehensiveAPIWithoutRaw :: Proxy ComprehensiveAPI
145+comprehensiveAPIWithoutRaw = comprehensiveAPI
146+#endif