on master help sign in
Add regression test for #734
commit6fff76e304a7aa037d49e098db960630ef0e36ce authorOleg Grenrus <oleg.grenrus@iki.fi> dateMon 15 May 2017, 19:45 (9 years ago) parentacbcebc
2 files changed+33
servant/servant.cabal+1 servant/test/Servant/Utils/EnterSpec.hs+32
servant/servant.cabal+1
@@ -112,6 +112,7 @@ test-suite spec
112112 Servant.API.ContentTypesSpec
113113 Servant.API.ResponseHeadersSpec
114114 Servant.Utils.LinksSpec
115+ Servant.Utils.EnterSpec
115116 build-depends:
116117 base == 4.*
117118 , 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 ()