Skip to content

Commit

Permalink
Make doctests accept GHC-8.0 formatted type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed May 10, 2016
1 parent 7ef2715 commit fd19694
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion servant-server/servant-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ test-suite spec
, servant
, servant-server
, string-conversions
, should-not-typecheck == 2.*
, should-not-typecheck == 2.1.*
, temporary
, text
, transformers
Expand Down
2 changes: 1 addition & 1 deletion servant-server/src/Servant/Server/Internal/Context.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 2 additions & 8 deletions servant/src/Servant/Utils/Links.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions servant/test/Servant/Utils/LinksSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fd19694

Please sign in to comment.