Skip to content

Commit fd19694

Browse files
committed
Make doctests accept GHC-8.0 formatted type errors
1 parent 7ef2715 commit fd19694

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

servant-server/servant-server.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ test-suite spec
122122
, servant
123123
, servant-server
124124
, string-conversions
125-
, should-not-typecheck == 2.*
125+
, should-not-typecheck == 2.1.*
126126
, temporary
127127
, text
128128
, transformers

servant-server/src/Servant/Server/Internal/Context.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ instance (Eq a, Eq (Context as)) => Eq (Context (a ': as)) where
5959
--
6060
-- >>> getContextEntry (True :. False :. EmptyContext) :: String
6161
-- ...
62-
-- No instance for (HasContextEntry '[] [Char])
62+
-- ...No instance for (HasContextEntry '[] [Char])
6363
-- ...
6464
class HasContextEntry (context :: [*]) (val :: *) where
6565
getContextEntry :: Context context -> val

servant/src/Servant/Utils/Links.hs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,8 @@
7272
-- >>> let bad_link = Proxy :: Proxy ("hello" :> Delete '[JSON] ())
7373
-- >>> safeLink api bad_link
7474
-- ...
75-
-- Could not deduce (Or
76-
-- (IsElem' (Verb 'DELETE 200 '[JSON] ()) (Verb 'GET 200 '[JSON] Int))
77-
-- (IsElem'
78-
-- ("hello" :> Delete '[JSON] ())
79-
-- ("bye" :> (QueryParam "name" String :> Delete '[JSON] ()))))
80-
-- arising from a use of ‘safeLink’
81-
-- In the expression: safeLink api bad_link
82-
-- In an equation for ‘it’: it = safeLink api bad_link
75+
-- ...Could not deduce...
76+
-- ...
8377
--
8478
-- This error is essentially saying that the type family couldn't find
8579
-- bad_link under api after trying the open (but empty) type family

servant/test/Servant/Utils/LinksSpec.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,27 @@ spec = describe "Servant.Utils.Links" $ do
6767
--
6868
-- >>> apiLink (Proxy :: Proxy WrongPath)
6969
-- ...
70-
-- Could not deduce ...
70+
-- ...Could not deduce...
7171
-- ...
7272
--
7373
-- >>> apiLink (Proxy :: Proxy WrongReturnType)
7474
-- ...
75-
-- Could not deduce ...
75+
-- ...Could not deduce...
7676
-- ...
7777
--
7878
-- >>> apiLink (Proxy :: Proxy WrongContentType)
7979
-- ...
80-
-- Could not deduce ...
80+
-- ...Could not deduce...
8181
-- ...
8282
--
8383
-- >>> apiLink (Proxy :: Proxy WrongMethod)
8484
-- ...
85-
-- Could not deduce ...
85+
-- ...Could not deduce...
8686
-- ...
8787
--
8888
-- >>> apiLink (Proxy :: Proxy NotALink)
8989
-- ...
90-
-- Could not deduce ...
90+
-- ...Could not deduce...
9191
-- ...
9292
--
9393
-- sanity check

0 commit comments

Comments
 (0)