on master help sign in
Merge pull request #751 from phadej/regression-734
3015152Oleg Grenrus
servant/servant.cabal+1
@@ -112,6 +112,7 @@ test-suite spec
112 Servant.API.ContentTypesSpec
112 Servant.API.ContentTypesSpec
113 Servant.API.ResponseHeadersSpec
113 Servant.API.ResponseHeadersSpec
114 Servant.Utils.LinksSpec
114 Servant.Utils.LinksSpec
115+ Servant.Utils.EnterSpec
115 build-depends:
116 build-depends:
116 base == 4.*
117 base == 4.*
117 , base-compat
118 , base-compat
servant/test/Servant/Utils/EnterSpec.hsnew file+32
@@ -0,0 +1,32 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE TypeOperators #-}
3+module Servant.Utils.EnterSpec where
4+
5+import Test.Hspec (Spec)
6+
7+import Servant.API
8+import Servant.Utils.Enter
9+
10+-------------------------------------------------------------------------------
11+-- https://github.com/haskell-servant/servant/issues/734
12+-------------------------------------------------------------------------------
13+
14+-- This didn't fail if executed in GHCi; cannot have as a doctest.
15+
16+data App a
17+
18+f :: App :~> App
19+f = NT id
20+
21+server :: App Int :<|> (String -> App Bool)
22+server = undefined
23+
24+server' :: App Int :<|> (String -> App Bool)
25+server' = enter f server
26+
27+-------------------------------------------------------------------------------
28+-- Spec
29+-------------------------------------------------------------------------------
30+
31+spec :: Spec
32+spec = return ()