Skip to content

Commit

Permalink
Fix servant-quickcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
theophile-scrive committed Jul 10, 2024
1 parent 37a25c1 commit a7f18b4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Data.Kind (Type)
import Data.String (fromString)
import qualified Data.Text.Encoding as Text
import qualified Data.ByteString.Char8 as BS8
import GHC.TypeLits (KnownSymbol, Nat, symbolVal)
import GHC.TypeLits (KnownSymbol, Nat, symbolVal, Symbol)
import Network.HTTP.Client (Request, RequestBody (..),
defaultRequest, host, method, path,
port, queryString, requestBody,
Expand All @@ -22,6 +22,7 @@ import Test.QuickCheck (Arbitrary (..), Gen, elements,

import qualified Data.ByteString as BS
import qualified Data.ByteString.Internal as BS (c2w)
import Servant.API.MultiVerb (MultiVerb, Respond)


-- -----------------------------------------------------------------------------
Expand Down Expand Up @@ -164,7 +165,7 @@ instance (KnownSymbol x, HasGenRequest b)
param = BS8.pack $ symbolVal (Proxy :: Proxy x)

instance (ReflectMethod method)
=> HasGenRequest (Verb (method :: k) (status :: Nat) (cts :: [Type]) a) where
=> HasGenRequest (MultiVerb (method :: k) (cts :: [Type]) '[Respond (status :: Nat) (desc :: Symbol) a] a) where
genRequest _ = (1, return $ \burl -> defaultRequest
{ host = BS8.pack $ baseUrlHost burl
, port = baseUrlPort burl
Expand Down

0 comments on commit a7f18b4

Please sign in to comment.