diff --git a/servant-quickcheck.cabal b/servant-quickcheck.cabal index cf83653..53e4975 100644 --- a/servant-quickcheck.cabal +++ b/servant-quickcheck.cabal @@ -33,26 +33,26 @@ library , Servant.QuickCheck.Internal.ErrorTypes build-depends: base >=4.8 && <4.10 , base-compat == 0.9.* - , aeson > 0.8 && < 0.12 + , aeson > 0.8 && < 2 , bytestring == 0.10.* , case-insensitive == 1.2.* , data-default-class >= 0.0 && < 0.2 , hspec == 2.2.* - , http-client >= 0.4.30 && < 0.5 + , http-client >= 0.4.30 && < 0.6 , http-media == 0.6.* , http-types > 0.8 && < 0.10 , mtl > 2.1 && < 2.3 , pretty == 1.1.* , process >= 1.2 && < 1.5 - , QuickCheck > 2.7 && < 2.9 - , servant > 0.6 && < 0.9 - , servant-client > 0.6 && < 0.9 - , servant-server > 0.6 && < 0.9 + , QuickCheck > 2.7 && < 2.10 + , servant > 0.6 && < 0.10 + , servant-client > 0.6 && < 0.10 + , servant-server > 0.6 && < 0.10 , split == 0.2.* , string-conversions > 0.3 && < 0.5 , temporary == 1.2.* , text == 1.* - , time == 1.5.* + , time >= 1.5 && < 1.7 , warp >= 3.2.4 && < 3.3 hs-source-dirs: src diff --git a/src/Servant/QuickCheck/Internal/HasGenRequest.hs b/src/Servant/QuickCheck/Internal/HasGenRequest.hs index 407c0ab..2047dee 100644 --- a/src/Servant/QuickCheck/Internal/HasGenRequest.hs +++ b/src/Servant/QuickCheck/Internal/HasGenRequest.hs @@ -2,7 +2,6 @@ {-# LANGUAGE PolyKinds #-} module Servant.QuickCheck.Internal.HasGenRequest where -import Data.Default.Class (def) import Data.Monoid ((<>)) import Data.String (fromString) import Data.String.Conversions (cs) @@ -10,7 +9,7 @@ import qualified Data.ByteString as BS import GHC.TypeLits (KnownSymbol, Nat, symbolVal) import Network.HTTP.Client (Request, RequestBody (..), host, method, path, port, queryString, requestBody, requestHeaders, - secure) + secure, defaultRequest) import Network.HTTP.Media (renderHeader) import Prelude.Compat import Servant @@ -125,7 +124,7 @@ instance (KnownSymbol x, HasGenRequest b) instance (ReflectMethod method) => HasGenRequest (Verb (method :: k) (status :: Nat) (cts :: [*]) a) where - genRequest _ = return $ \burl -> def + genRequest _ = return $ \burl -> defaultRequest { host = cs $ baseUrlHost burl , port = baseUrlPort burl , secure = baseUrlScheme burl == Https diff --git a/src/Servant/QuickCheck/Internal/QuickCheck.hs b/src/Servant/QuickCheck/Internal/QuickCheck.hs index 2989ce1..fe30188 100644 --- a/src/Servant/QuickCheck/Internal/QuickCheck.hs +++ b/src/Servant/QuickCheck/Internal/QuickCheck.hs @@ -1,4 +1,5 @@ {-# LANGUAGE RecordWildCards #-} +{-# LANGUAGE CPP #-} module Servant.QuickCheck.Internal.QuickCheck where import Control.Concurrent (modifyMVar_, newMVar, readMVar) @@ -144,7 +145,11 @@ serverDoesntSatisfy api burl args preds = do InsufficientCoverage {} -> expectationFailure $ "Insufficient coverage" noCheckStatus :: C.Request -> C.Request +#if MIN_VERSION_http_client(0,5,0) +noCheckStatus = id +#else noCheckStatus r = r { C.checkStatus = \_ _ _ -> Nothing} +#endif defManager :: C.Manager defManager = unsafePerformIO $ C.newManager C.defaultManagerSettings diff --git a/stack-ghc-8.0.1.yaml b/stack-ghc-8.0.1.yaml index ba8bdb2..e92c0d3 100644 --- a/stack-ghc-8.0.1.yaml +++ b/stack-ghc-8.0.1.yaml @@ -1,10 +1,10 @@ # Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) -resolver: nightly-2016-09-07 +resolver: nightly-2016-10-03 packages: - '.' extra-deps: -- 'servant-0.8.1' -- 'servant-server-0.8.1' -- 'servant-client-0.8.1' +- 'servant-0.9' +- 'servant-server-0.9' +- 'servant-client-0.9' flags: {} extra-package-dbs: [] diff --git a/test/Servant/QuickCheck/InternalSpec.hs b/test/Servant/QuickCheck/InternalSpec.hs index 91c5691..f0e306f 100644 --- a/test/Servant/QuickCheck/InternalSpec.hs +++ b/test/Servant/QuickCheck/InternalSpec.hs @@ -5,7 +5,11 @@ import Control.Concurrent.MVar (newMVar, readMVar, swapMVar) import Control.Monad.IO.Class (liftIO) import Prelude.Compat import Servant +#if MIN_VERSION_servant(0,8,0) import Servant.API.Internal.Test.ComprehensiveAPI (comprehensiveAPIWithoutRaw) +#else +import Servant.API.Internal.Test.ComprehensiveAPI (comprehensiveAPI, ComprehensiveAPI) +#endif import Test.Hspec (Spec, context, describe, it, shouldBe, shouldContain) import Test.Hspec.Core.Spec (Arg, Example, Result (..), @@ -135,3 +139,8 @@ noOfTestCases = 20000 #else noOfTestCases = 1000 #endif + +#if !MIN_VERSION_servant(0,8,0) +comprehensiveAPIWithoutRaw :: Proxy ComprehensiveAPI +comprehensiveAPIWithoutRaw = comprehensiveAPI +#endif