git.iko.soy/servant-quickcheck
on master help sign in
Cleanup
commit86d99239bbf768bdc5eb0ae5aad070195ee90c72 authorJulian K. Arni <jkarni@gmail.com> dateSun 28 Aug 2016, 19:31 (10 years ago) parentca0b715
4 files changed+14−20
servant-quickcheck.cabal+4−3 src/Servant/QuickCheck/Internal/Predicates.hs+4−8 src/Servant/QuickCheck/Internal/QuickCheck.hs+3−6 stack.yaml+3−3
servant-quickcheck.cabal+4−3
@@ -36,11 +36,11 @@ library
3636 , http-client == 0.4.*
3737 , http-types == 0.9.*
3838 , http-media == 0.6.*
39− , servant-client == 0.7.*
40− , servant-server == 0.7.*
39+ , servant-client > 0.6 && < 0.9
40+ , servant-server > 0.6 && < 0.9
4141 , string-conversions == 0.4.*
4242 , data-default-class == 0.0.*
43− , servant == 0.7.*
43+ , servant > 0.6 && < 0.9
4444 , warp >= 3.2.4 && < 3.3
4545 , process == 1.2.*
4646 , temporary == 1.2.*
@@ -68,6 +68,7 @@ library
6868 , OverloadedStrings
6969 , FunctionalDependencies
7070 , NoImplicitPrelude
71+ , AutoDeriveTypeable
7172 default-language: Haskell2010
7273
7374test-suite spec
src/Servant/QuickCheck/Internal/Predicates.hs+4−8
@@ -1,10 +1,8 @@
11module Servant.QuickCheck.Internal.Predicates where
22
3−import Control.Exception (SomeException, catch, throw)
4−import Control.Monad (ap, guard, liftM2)
3+import Control.Exception (catch, throw)
54import Control.Monad.Reader
65import Data.Aeson (Object, decode)
7−import Data.Bifunctor (Bifunctor (..))
86import qualified Data.ByteString as SBS
97import qualified Data.ByteString.Char8 as SBSC
108import qualified Data.ByteString.Lazy as LBS
@@ -13,12 +11,10 @@ import Data.Either (isRight)
1311import Data.List.Split (wordsBy)
1412import Data.Maybe (fromMaybe, isJust)
1513import Data.Monoid ((<>))
16−import Data.Text (Text)
1714import GHC.Generics (Generic)
1815import Network.HTTP.Client (Manager, Request, Response, httpLbs,
19− method, parseUrl, requestHeaders,
20− responseBody, responseHeaders,
21− responseStatus)
16+ method, requestHeaders, responseBody,
17+ responseHeaders, parseUrl, responseStatus)
2218import Network.HTTP.Media (matchAccept)
2319import Network.HTTP.Types (methodGet, methodHead, parseMethod,
2420 renderStdMethod, status100, status200,
@@ -134,7 +130,7 @@ notAllowedContainsAllowHeader
134130 | m <- [minBound .. maxBound ]
135131 , renderStdMethod m /= method req ]
136132 case filter pred' resp of
137− (x:xs) -> throw $ PredicateFailure "notAllowedContainsAllowHeader" (Just req) x
133+ (x:_) -> throw $ PredicateFailure "notAllowedContainsAllowHeader" (Just req) x
138134 [] -> return resp
139135 where
140136 pred' resp = responseStatus resp == status405 && not (hasValidHeader "Allow" go resp)
src/Servant/QuickCheck/Internal/QuickCheck.hs+3−6
@@ -5,9 +5,6 @@ import Control.Concurrent (modifyMVar_, newMVar, readMVar)
55import Control.Monad (unless)
66import qualified Data.ByteString.Lazy as LBS
77import Data.Proxy (Proxy)
8−import Data.String (IsString (..))
9−import Data.Text (Text)
10−import GHC.Generics (Generic)
118import qualified Network.HTTP.Client as C
129import Network.Wai.Handler.Warp (withApplication)
1310import Prelude.Compat
@@ -87,7 +84,7 @@ serversEqual api burl1 burl2 args req = do
8784 assert False
8885 case r of
8986 Success {} -> return ()
90− f@Failure{..} -> readMVar deetsMVar >>= \x -> expectationFailure $
87+ Failure{..} -> readMVar deetsMVar >>= \x -> expectationFailure $
9188 "Failed:\n" ++ show x
9289 GaveUp { numTests = n } -> expectationFailure $ "Gave up after " ++ show n ++ " tests"
9390 NoExpectedFailure {} -> expectationFailure $ "No expected failure"
@@ -121,11 +118,11 @@ serverSatisfies api burl args preds = do
121118 v <- run $ finishPredicates preds (noCheckStatus req) defManager
122119 run $ modifyMVar_ deetsMVar $ const $ return v
123120 case v of
124− Just x -> assert False
121+ Just _ -> assert False
125122 _ -> return ()
126123 case r of
127124 Success {} -> return ()
128− f@Failure{..} -> readMVar deetsMVar >>= \x -> expectationFailure $
125+ Failure{..} -> readMVar deetsMVar >>= \x -> expectationFailure $
129126 "Failed:\n" ++ show x
130127 GaveUp { numTests = n } -> expectationFailure $ "Gave up after " ++ show n ++ " tests"
131128 NoExpectedFailure {} -> expectationFailure $ "No expected failure"
stack.yaml+3−3
@@ -7,9 +7,9 @@ packages:
77
88# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
99extra-deps:
10−- servant-0.7
11−- servant-client-0.7
12−- servant-server-0.7
10+- servant-0.8
11+- servant-client-0.8
12+- servant-server-0.8
1313
1414# Override default flag values for local packages and extra-deps
1515flags: {}