Make doctests accept GHC-8.0 formatted type errors

This commit is contained in:
Oleg Grenrus 2016-04-17 21:50:45 +03:00
parent 7ef27152b9
commit fd19694ed5
4 changed files with 9 additions and 15 deletions

View File

@ -122,7 +122,7 @@ test-suite spec
, servant
, servant-server
, string-conversions
, should-not-typecheck == 2.*
, should-not-typecheck == 2.1.*
, temporary
, text
, transformers

View File

@ -59,7 +59,7 @@ instance (Eq a, Eq (Context as)) => Eq (Context (a ': as)) where
--
-- >>> getContextEntry (True :. False :. EmptyContext) :: String
-- ...
-- No instance for (HasContextEntry '[] [Char])
-- ...No instance for (HasContextEntry '[] [Char])
-- ...
class HasContextEntry (context :: [*]) (val :: *) where
getContextEntry :: Context context -> val

View File

@ -72,14 +72,8 @@
-- >>> let bad_link = Proxy :: Proxy ("hello" :> Delete '[JSON] ())
-- >>> safeLink api bad_link
-- ...
-- Could not deduce (Or
-- (IsElem' (Verb 'DELETE 200 '[JSON] ()) (Verb 'GET 200 '[JSON] Int))
-- (IsElem'
-- ("hello" :> Delete '[JSON] ())
-- ("bye" :> (QueryParam "name" String :> Delete '[JSON] ()))))
-- arising from a use of safeLink
-- In the expression: safeLink api bad_link
-- In an equation for it: it = safeLink api bad_link
-- ...Could not deduce...
-- ...
--
-- This error is essentially saying that the type family couldn't find
-- bad_link under api after trying the open (but empty) type family

View File

@ -67,27 +67,27 @@ spec = describe "Servant.Utils.Links" $ do
--
-- >>> apiLink (Proxy :: Proxy WrongPath)
-- ...
-- Could not deduce ...
-- ...Could not deduce...
-- ...
--
-- >>> apiLink (Proxy :: Proxy WrongReturnType)
-- ...
-- Could not deduce ...
-- ...Could not deduce...
-- ...
--
-- >>> apiLink (Proxy :: Proxy WrongContentType)
-- ...
-- Could not deduce ...
-- ...Could not deduce...
-- ...
--
-- >>> apiLink (Proxy :: Proxy WrongMethod)
-- ...
-- Could not deduce ...
-- ...Could not deduce...
-- ...
--
-- >>> apiLink (Proxy :: Proxy NotALink)
-- ...
-- Could not deduce ...
-- ...Could not deduce...
-- ...
--
-- sanity check