packages feed

servant-quickcheck 0.0.5.0 → 0.0.6.0

raw patch · 4 files changed

+67/−14 lines, 4 filesdep ~QuickCheckdep ~basedep ~hspecnew-uploaderPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: QuickCheck, base, hspec, http-types, servant, servant-client, servant-server, text

API changes (from Hackage documentation)

- Servant.QuickCheck: data Proxy k (t :: k) :: forall k. k -> *
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k (a :: k) (x :: GHC.Types.Symbol) y. Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest a => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.BasicAuth.BasicAuth x y Servant.API.Sub.:> a)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k (a :: k). Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest a => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Data.Vault.Lazy.Vault Servant.API.Sub.:> a)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k (a :: k). Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest a => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Network.HTTP.Types.Version.HttpVersion Servant.API.Sub.:> a)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k (a :: k). Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest a => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.IsSecure.IsSecure Servant.API.Sub.:> a)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k (a :: k). Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest a => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.RemoteHost.RemoteHost Servant.API.Sub.:> a)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k (api :: k) (d :: GHC.Types.Symbol). Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest api => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.Description.Description d Servant.API.Sub.:> api)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k (api :: k) (d :: GHC.Types.Symbol). Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest api => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.Description.Summary d Servant.API.Sub.:> api)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k (path :: GHC.Types.Symbol) (b :: k). (GHC.TypeLits.KnownSymbol path, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (path Servant.API.Sub.:> b)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k (x :: GHC.Types.Symbol) (b :: k). (GHC.TypeLits.KnownSymbol x, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.QueryParam.QueryFlag x Servant.API.Sub.:> b)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k (x :: GHC.Types.Symbol) c (b :: k). (GHC.TypeLits.KnownSymbol x, Test.QuickCheck.Arbitrary.Arbitrary c, Web.Internal.HttpApiData.ToHttpApiData c, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.QueryParam.QueryParam x c Servant.API.Sub.:> b)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k (x :: GHC.Types.Symbol) c (b :: k). (GHC.TypeLits.KnownSymbol x, Test.QuickCheck.Arbitrary.Arbitrary c, Web.Internal.HttpApiData.ToHttpApiData c, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.QueryParam.QueryParams x c Servant.API.Sub.:> b)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k (x :: [GHC.Types.*]) c (b :: k). (Servant.API.ContentTypes.AllMimeRender x c, Test.QuickCheck.Arbitrary.Arbitrary c, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.ReqBody.ReqBody x c Servant.API.Sub.:> b)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k c (b :: k) (x :: GHC.Types.Symbol). (Test.QuickCheck.Arbitrary.Arbitrary c, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b, Web.Internal.HttpApiData.ToHttpApiData c) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.Capture.Capture x c Servant.API.Sub.:> b)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k c (b :: k) (x :: GHC.Types.Symbol). (Test.QuickCheck.Arbitrary.Arbitrary c, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b, Web.Internal.HttpApiData.ToHttpApiData c) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.Capture.CaptureAll x c Servant.API.Sub.:> b)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k c (h :: GHC.Types.Symbol) (b :: k). (Test.QuickCheck.Arbitrary.Arbitrary c, GHC.TypeLits.KnownSymbol h, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b, Web.Internal.HttpApiData.ToHttpApiData c) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.Header.Header h c Servant.API.Sub.:> b)
- Servant.QuickCheck.Internal.HasGenRequest: instance forall k k1 (method :: k1) (status :: GHC.Types.Nat) (cts :: [GHC.Types.*]) (a :: k). Servant.API.Verbs.ReflectMethod method => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.Verbs.Verb method status cts a)
+ Servant.QuickCheck: data Proxy k (t :: k) :: forall k. () => k -> *
+ Servant.QuickCheck.Internal.HasGenRequest: instance (GHC.TypeLits.KnownSymbol path, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (path Servant.API.Sub.:> b)
+ Servant.QuickCheck.Internal.HasGenRequest: instance (GHC.TypeLits.KnownSymbol x, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.QueryParam.QueryFlag x Servant.API.Sub.:> b)
+ Servant.QuickCheck.Internal.HasGenRequest: instance (GHC.TypeLits.KnownSymbol x, Test.QuickCheck.Arbitrary.Arbitrary c, Web.Internal.HttpApiData.ToHttpApiData c, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.QueryParam.QueryParam' mods x c Servant.API.Sub.:> b)
+ Servant.QuickCheck.Internal.HasGenRequest: instance (GHC.TypeLits.KnownSymbol x, Test.QuickCheck.Arbitrary.Arbitrary c, Web.Internal.HttpApiData.ToHttpApiData c, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.QueryParam.QueryParams x c Servant.API.Sub.:> b)
+ Servant.QuickCheck.Internal.HasGenRequest: instance (Servant.API.ContentTypes.AllMimeRender x c, Test.QuickCheck.Arbitrary.Arbitrary c, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.ReqBody.ReqBody' mods x c Servant.API.Sub.:> b)
+ Servant.QuickCheck.Internal.HasGenRequest: instance (Test.QuickCheck.Arbitrary.Arbitrary c, GHC.TypeLits.KnownSymbol h, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b, Web.Internal.HttpApiData.ToHttpApiData c) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.Header.Header' mods h c Servant.API.Sub.:> b)
+ Servant.QuickCheck.Internal.HasGenRequest: instance (Test.QuickCheck.Arbitrary.Arbitrary c, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b, Web.Internal.HttpApiData.ToHttpApiData c) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.Capture.Capture' mods x c Servant.API.Sub.:> b)
+ Servant.QuickCheck.Internal.HasGenRequest: instance (Test.QuickCheck.Arbitrary.Arbitrary c, Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest b, Web.Internal.HttpApiData.ToHttpApiData c) => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.Capture.CaptureAll x c Servant.API.Sub.:> b)
+ Servant.QuickCheck.Internal.HasGenRequest: instance Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest a => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Data.Vault.Lazy.Vault Servant.API.Sub.:> a)
+ Servant.QuickCheck.Internal.HasGenRequest: instance Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest a => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Network.HTTP.Types.Version.HttpVersion Servant.API.Sub.:> a)
+ Servant.QuickCheck.Internal.HasGenRequest: instance Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest a => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.BasicAuth.BasicAuth x y Servant.API.Sub.:> a)
+ Servant.QuickCheck.Internal.HasGenRequest: instance Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest a => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.IsSecure.IsSecure Servant.API.Sub.:> a)
+ Servant.QuickCheck.Internal.HasGenRequest: instance Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest a => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.RemoteHost.RemoteHost Servant.API.Sub.:> a)
+ Servant.QuickCheck.Internal.HasGenRequest: instance Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest api => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.Description.Description d Servant.API.Sub.:> api)
+ Servant.QuickCheck.Internal.HasGenRequest: instance Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest api => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.Description.Summary d Servant.API.Sub.:> api)
+ Servant.QuickCheck.Internal.HasGenRequest: instance forall k (method :: k) (status :: GHC.Types.Nat) (cts :: [*]) a. Servant.API.Verbs.ReflectMethod method => Servant.QuickCheck.Internal.HasGenRequest.HasGenRequest (Servant.API.Verbs.Verb method status cts a)
- Servant.QuickCheck.Internal.Equality: class JsonEq a where jsonEq first second = compareDecodedResponses (decode' first) (decode' second)
+ Servant.QuickCheck.Internal.Equality: class JsonEq a

Files

CHANGELOG.yaml view
@@ -2,6 +2,14 @@  releases: +  - version: "0.0.6.0"+    changes:++      - description: Support for servant-0.12+        issue: none+        authors: phadej+        date: 2018-02-09+   - version: "0.0.5.0"     changes: 
+ example/Main.hs view
@@ -0,0 +1,31 @@+{-# LANGUAGE OverloadedStrings, DataKinds #-}+module Main (main) where++import Servant+import Servant.QuickCheck+import Test.Hspec+import Data.Text (Text)+import System.Environment (getArgs)++main :: IO ()+main = do+    args <- getArgs+    case args of+        [] -> putStrLn "Not running without arguments. Try --help or --fail-fast."+        _  -> hspec spec++-- Change to String to reproduce+-- https://github.com/haskell-servant/servant-quickcheck/issues/41+type API = Get '[PlainText] Text++api :: Proxy API+api = Proxy++server :: Server API+server = return "Sigurð Fáfnirslayer"++spec :: Spec+spec = describe "example server" $+    it "mangles UTF-8 in error messages" $+        withServantServer api (return server) $ \burl ->+            serverSatisfies api burl defaultArgs (getsHaveCacheControlHeader <%> mempty)
servant-quickcheck.cabal view
@@ -1,5 +1,5 @@ name:                servant-quickcheck-version:             0.0.5.0+version:             0.0.6.0 synopsis:            QuickCheck entire APIs description:  This packages provides QuickCheck properties that are tested across an entire@@ -17,7 +17,7 @@ tested-with:   GHC==7.10.3,   GHC==8.0.2,-  GHC==8.2.1+  GHC==8.2.2  source-repository head   type: git@@ -45,14 +45,14 @@                      , hspec >= 2.2 && < 2.5                      , http-client >= 0.4.30 && < 0.6                      , http-media >= 0.6 && <0.8-                     , http-types > 0.8 && < 0.11+                     , http-types > 0.8 && < 0.13                      , mtl > 2.1 && < 2.3                      , pretty == 1.1.*                      , process >= 1.2 && < 1.7-                     , QuickCheck > 2.7 && < 2.11-                     , servant > 0.6 && < 0.13-                     , servant-client > 0.6 && < 0.13-                     , servant-server > 0.6 && < 0.13+                     , QuickCheck > 2.7 && < 2.12+                     , servant >= 0.13 && < 0.14+                     , servant-client >= 0.13 && < 0.14+                     , servant-server >= 0.13 && < 0.14                      , split == 0.2.*                      , string-conversions > 0.3 && < 0.5                      , temporary == 1.2.*@@ -114,3 +114,17 @@                      , ScopedTypeVariables   if flag(long-tests)       cpp-options: -DLONG_TESTS++test-suite example+  type: exitcode-stdio-1.0+  main-is: Main.hs+  hs-source-dirs:+    example+  ghc-options: -Wall+  build-depends:+      base+    , hspec+    , servant-server+    , servant-quickcheck+    , text+  default-language: Haskell2010
src/Servant/QuickCheck/Internal/HasGenRequest.hs view
@@ -78,7 +78,7 @@ #endif  instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )-    => HasGenRequest (Capture x c :> b) where+    => HasGenRequest (Capture' mods x c :> b) where     genRequest _ = (oldf, do       old' <- old       new' <- toUrlPiece <$> new@@ -101,10 +101,10 @@ #endif  instance (Arbitrary c, KnownSymbol h, HasGenRequest b, ToHttpApiData c)-    => HasGenRequest (Header h c :> b) where+    => HasGenRequest (Header' mods h c :> b) where     genRequest _ = (oldf, do       old' <- old-      new' <- toUrlPiece <$> new+      new' <- toUrlPiece <$> new  -- TODO: generate lenient or/and optional       return $ \burl -> let r = old' burl in r {           requestHeaders = (hdr, cs new') : requestHeaders r })       where@@ -113,9 +113,9 @@         new = arbitrary :: Gen c  instance (AllMimeRender x c, Arbitrary c, HasGenRequest b)-    => HasGenRequest (ReqBody x c :> b) where+    => HasGenRequest (ReqBody' mods x c :> b) where     genRequest _ = (oldf, do-      old' <- old+      old' <- old  -- TODO: generate lenient       new' <- new       (ct, bd) <- elements $ allMimeRender (Proxy :: Proxy x) new'       return $ \burl -> let r = old' burl in r {@@ -127,9 +127,9 @@         new = arbitrary :: Gen c  instance (KnownSymbol x, Arbitrary c, ToHttpApiData c, HasGenRequest b)-    => HasGenRequest (QueryParam x c :> b) where+    => HasGenRequest (QueryParam' mods x c :> b) where     genRequest _ = (oldf, do-      new' <- new+      new' <- new  -- TODO: generate lenient or/and optional       old' <- old       return $ \burl -> let r = old' burl                             newExpr = param <> "=" <> cs (toQueryParam new')