From e60bdadead842506b8188cac72126173dcb5cdde Mon Sep 17 00:00:00 2001 From: David Turner Date: Tue, 16 May 2017 10:21:37 +0000 Subject: [PATCH] Demonstrate that a client for EmptyAPI pattern-matches EmptyAPIClient --- servant-client/test/Servant/ClientSpec.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/servant-client/test/Servant/ClientSpec.hs b/servant-client/test/Servant/ClientSpec.hs index 219a178c..882c2a74 100644 --- a/servant-client/test/Servant/ClientSpec.hs +++ b/servant-client/test/Servant/ClientSpec.hs @@ -111,6 +111,8 @@ type Api = Get '[JSON] (String, Maybe Int, Bool, [(String, [Rational])]) :<|> "headers" :> Get '[JSON] (Headers TestHeaders Bool) :<|> "deleteContentType" :> DeleteNoContent '[JSON] NoContent + :<|> "empty" :> EmptyAPI + api :: Proxy Api api = Proxy @@ -130,6 +132,7 @@ getMultiple :: String -> Maybe Int -> Bool -> [(String, [Rational])] -> SCR.ClientM (String, Maybe Int, Bool, [(String, [Rational])]) getRespHeaders :: SCR.ClientM (Headers TestHeaders Bool) getDeleteContentType :: SCR.ClientM NoContent + getGet :<|> getDeleteEmpty :<|> getCapture @@ -142,7 +145,8 @@ getGet :<|> getRawFailure :<|> getMultiple :<|> getRespHeaders - :<|> getDeleteContentType = client api + :<|> getDeleteContentType + :<|> EmptyAPIClient = client api server :: Application server = serve api ( @@ -162,6 +166,7 @@ server = serve api ( :<|> (\ a b c d -> return (a, b, c, d)) :<|> (return $ addHeader 1729 $ addHeader "eg2" True) :<|> return NoContent + :<|> emptyAPIServer )