git.iko.soy/servant-quickcheck
on master help sign in
QuickCheck 2.12 Compatibility

This commit relaxes the bounds on QuickCheck, allowing it to be compatible with 2.12. In order to be compatible with 2.12, we had to CPP some definitions that referenced code that was deleted.

commit0190e5e7378b7c5f28ba23aff731c4f802eeb4ba authorparsonsmatt <parsonsmatt@gmail.com> dateTue 4 Sep 2018, 19:26 (8 years ago) parent7d6a97a
3 files changed+21−10
servant-quickcheck.cabal+4−3 src/Servant/QuickCheck/Internal/QuickCheck.hs+11−2 stack.yaml+6−5
servant-quickcheck.cabal+4−3
@@ -44,14 +44,15 @@ library
4444 , case-insensitive == 1.2.*
4545 , clock >= 0.7 && < 0.8
4646 , data-default-class >= 0.0 && < 0.2
47− , hspec >= 2.5 && < 2.6
47+ , hspec >= 2.5.5 && < 2.6
48+
4849 , http-client >= 0.4.30 && < 0.6
4950 , http-media >= 0.6 && <0.8
5051 , http-types > 0.8 && < 0.13
5152 , mtl > 2.1 && < 2.3
5253 , pretty == 1.1.*
5354 , process >= 1.2 && < 1.7
54− , QuickCheck > 2.7 && < 2.12
55+ , QuickCheck > 2.7 && < 2.13
5556 , servant >= 0.13 && < 0.15
5657 , servant-client >= 0.13 && < 0.15
5758 , servant-server >= 0.13 && < 0.15
@@ -99,7 +100,7 @@ test-suite spec
99100 , servant-quickcheck
100101 , bytestring
101102 , hspec
102− , hspec-core
103+ , hspec-core >= 2.5.5 && < 2.6
103104 , http-client
104105 , blaze-html
105106 , warp
src/Servant/QuickCheck/Internal/QuickCheck.hs+11−2
@@ -92,7 +92,10 @@ serversEqual api burl1 burl2 args req = do
9292 expectationFailure $ "We failed to record a reason for failure: " <> show r
9393 GaveUp { numTests = n } -> expectationFailure $ "Gave up after " ++ show n ++ " tests"
9494 NoExpectedFailure {} -> expectationFailure "No expected failure"
95+#if MIN_VERSION_QuickCheck(2,12,0)
96+#else
9597 InsufficientCoverage {} -> expectationFailure "Insufficient coverage"
98+#endif
9699
97100-- | Check that a server satisfies the set of properties specified.
98101--
@@ -145,7 +148,10 @@ serverSatisfiesMgr api manager burl args preds = do
145148 expectationFailure $ "We failed to record a reason for failure: " <> show r
146149 GaveUp { numTests = n } -> expectationFailure $ "Gave up after " ++ show n ++ " tests"
147150 NoExpectedFailure {} -> expectationFailure $ "No expected failure"
148− InsufficientCoverage {} -> expectationFailure $ "Insufficient coverage"
151+#if MIN_VERSION_QuickCheck(2,12,0)
152+#else
153+ InsufficientCoverage {} -> expectationFailure "Insufficient coverage"
154+#endif
149155
150156serverDoesntSatisfy :: (HasGenRequest a) =>
151157 Proxy a -> BaseUrl -> Args -> Predicates -> Expectation
@@ -163,7 +169,10 @@ serverDoesntSatisfyMgr api manager burl args preds = do
163169 GaveUp { numTests = n } -> expectationFailure $ "Gave up after " ++ show n ++ " tests"
164170 Failure { output = m } -> expectationFailure $ "Failed:\n" ++ show m
165171 NoExpectedFailure {} -> expectationFailure $ "No expected failure"
166− InsufficientCoverage {} -> expectationFailure $ "Insufficient coverage"
172+#if MIN_VERSION_QuickCheck(2,12,0)
173+#else
174+ InsufficientCoverage {} -> expectationFailure "Insufficient coverage"
175+#endif
167176
168177noCheckStatus :: C.Request -> C.Request
169178#if MIN_VERSION_http_client(0,5,0)
stack.yaml+6−5
@@ -1,14 +1,15 @@
1−resolver: lts-11.8
1+resolver: nightly-2018-09-03
22packages:
33- '.'
44extra-deps:
55- base-compat-batteries-0.10.1
66- base-compat-0.10.1
7−- hspec-discover-2.5.0
8−- hspec-core-2.5.0
9−- hspec-2.5.0
7+- hspec-discover-2.5.6
8+- hspec-core-2.5.6
9+- hspec-2.5.6
1010# aeson pre-1.3.1.0 has an upper bound on `base-compat-batteries` that preclude
1111# the 0.10.1 that we depend on
12−- aeson-1.3.1.0
12+# - aeson-1.3.1.0
13+- QuickCheck-2.12
1314flags: {}
1415extra-package-dbs: []