git.iko.soy/servant-quickcheck
on master help sign in
Support for servant-0.12
3571f54Oleg Grenrus
CHANGELOG.yaml+7
@@ -1,6 +1,13 @@
1upcoming:
1upcoming:
2
2
3releases:
3releases:
4+ - version: "0.0.4"
5+ changes:
6+
7+ - description: Support for Servant 0.12
8+ issue: none
9+ authors: phadej
10+ date: 2017-11-07
4
11
5 - version: "0.0.3.1"
12 - version: "0.0.3.1"
6 changes:
13 changes:
servant-quickcheck.cabal+13−9
@@ -1,5 +1,5 @@
1name: servant-quickcheck
1name: servant-quickcheck
2−version: 0.0.3.1
2+version: 0.0.4
3synopsis: QuickCheck entire APIs
3synopsis: QuickCheck entire APIs
4description:
4description:
5 This packages provides QuickCheck properties that are tested across an entire
5 This packages provides QuickCheck properties that are tested across an entire
@@ -14,6 +14,10 @@ build-type: Simple
14cabal-version: >=1.10
14cabal-version: >=1.10
15extra-source-files:
15extra-source-files:
16 CHANGELOG.yaml
16 CHANGELOG.yaml
17+tested-with:
18+ GHC==7.10.3,
19+ GHC==8.0.2,
20+ GHC==8.2.1
17
21
18source-repository head
22source-repository head
19 type: git
23 type: git
@@ -31,7 +35,7 @@ library
31 , Servant.QuickCheck.Internal.QuickCheck
35 , Servant.QuickCheck.Internal.QuickCheck
32 , Servant.QuickCheck.Internal.Equality
36 , Servant.QuickCheck.Internal.Equality
33 , Servant.QuickCheck.Internal.ErrorTypes
37 , Servant.QuickCheck.Internal.ErrorTypes
34− build-depends: base >=4.8 && <4.10
38+ build-depends: base >=4.8 && <4.11
35 , base-compat == 0.9.*
39 , base-compat == 0.9.*
36 , aeson > 0.8 && < 2
40 , aeson > 0.8 && < 2
37 , bytestring == 0.10.*
41 , bytestring == 0.10.*
@@ -40,20 +44,20 @@ library
40 , data-default-class >= 0.0 && < 0.2
44 , data-default-class >= 0.0 && < 0.2
41 , hspec >= 2.2 && < 2.5
45 , hspec >= 2.2 && < 2.5
42 , http-client >= 0.4.30 && < 0.6
46 , http-client >= 0.4.30 && < 0.6
43− , http-media == 0.6.*
47+ , http-media >= 0.6 && <0.8
44− , http-types > 0.8 && < 0.10
48+ , http-types > 0.8 && < 0.11
45 , mtl > 2.1 && < 2.3
49 , mtl > 2.1 && < 2.3
46 , pretty == 1.1.*
50 , pretty == 1.1.*
47− , process >= 1.2 && < 1.5
51+ , process >= 1.2 && < 1.7
48 , QuickCheck > 2.7 && < 2.11
52 , QuickCheck > 2.7 && < 2.11
49− , servant > 0.6 && < 0.12
53+ , servant > 0.6 && < 0.13
50− , servant-client > 0.6 && < 0.12
54+ , servant-client > 0.6 && < 0.13
51− , servant-server > 0.6 && < 0.12
55+ , servant-server > 0.6 && < 0.13
52 , split == 0.2.*
56 , split == 0.2.*
53 , string-conversions > 0.3 && < 0.5
57 , string-conversions > 0.3 && < 0.5
54 , temporary == 1.2.*
58 , temporary == 1.2.*
55 , text == 1.*
59 , text == 1.*
56− , time >= 1.5 && < 1.7
60+ , time >= 1.5 && < 1.9
57 , warp >= 3.2.4 && < 3.3
61 , warp >= 3.2.4 && < 3.3
58
62
59 hs-source-dirs: src
63 hs-source-dirs: src
src/Servant/QuickCheck/Internal/HasGenRequest.hs+8
@@ -69,6 +69,14 @@ instance HasGenRequest EmptyAPI where
69 genRequest _ = (0, error "EmptyAPIs cannot be queried.")
69 genRequest _ = (0, error "EmptyAPIs cannot be queried.")
70#endif
70#endif
71
71
72+#if MIN_VERSION_servant(0,12,0)
73+instance HasGenRequest api => HasGenRequest (Summary d :> api) where
74+ genRequest _ = genRequest (Proxy :: Proxy api)
75+
76+instance HasGenRequest api => HasGenRequest (Description d :> api) where
77+ genRequest _ = genRequest (Proxy :: Proxy api)
78+#endif
79+
72instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
80instance (Arbitrary c, HasGenRequest b, ToHttpApiData c )
73 => HasGenRequest (Capture x c :> b) where
81 => HasGenRequest (Capture x c :> b) where
74 genRequest _ = (oldf, do
82 genRequest _ = (oldf, do
test/Doctest.hsdeleted−44
@@ -1,44 +0,0 @@
1−module Main where
2−
3−import Data.List (isPrefixOf)
4−import System.Directory
5−import System.FilePath
6−import System.FilePath.Find
7−import Test.DocTest
8−
9−main :: IO ()
10−main = do
11− files <- find always (extension ==? ".hs") "src"
12− mCabalMacrosFile <- getCabalMacrosFile
13− doctest $ "-isrc" : "-Iinclude" :
14− (maybe [] (\ f -> ["-optP-include", "-optP" ++ f]) mCabalMacrosFile) ++
15− "-XOverloadedStrings" :
16− "-XDeriveFunctor" :
17− "-XFlexibleInstances" :
18− "-XFlexibleContexts" :
19− "-XMultiParamTypeClasses" :
20− "-XDataKinds" :
21− "-XTypeOperators" :
22− "-XGADTs" :
23− files
24−
25−getCabalMacrosFile :: IO (Maybe FilePath)
26−getCabalMacrosFile = do
27− exists <- doesDirectoryExist "dist"
28− if exists
29− then do
30− contents <- getDirectoryContents "dist"
31− let rest = "build" </> "autogen" </> "cabal_macros.h"
32− whenExists $ case filter ("dist-sandbox-" `isPrefixOf`) contents of
33− [x] -> "dist" </> x </> rest
34− [] -> "dist" </> rest
35− xs -> error $ "ran doctests with multiple dist/dist-sandbox-xxxxx's: \n"
36− ++ show xs ++ "\nTry cabal clean"
37− else return Nothing
38− where
39− whenExists :: FilePath -> IO (Maybe FilePath)
40− whenExists file = do
41− exists <- doesFileExist file
42− return $ if exists
43− then Just file
44− else Nothing