@@ -32,7 +32,6 @@ import Data.Foldable
32
32
import Data.Maybe
33
33
(listToMaybe )
34
34
import Data.Monoid ()
35
- import Data.SOP (NS (.. ), I (.. ))
36
35
import Data.Text
37
36
(Text )
38
37
import qualified Network.HTTP.Client as C
@@ -43,11 +42,9 @@ import Test.HUnit
43
42
import Test.QuickCheck
44
43
45
44
import Servant.API
46
- (NoContent (NoContent ), WithStatus (WithStatus ), getHeaders )
45
+ (NoContent (NoContent ), WithStatus (WithStatus ), getHeaders , Headers ( .. ) )
47
46
import Servant.Client
48
47
import qualified Servant.Client.Core.Request as Req
49
- import Servant.Client.Internal.HttpClient
50
- (defaultMakeClientRequest )
51
48
import Servant.ClientTestUtils
52
49
import Servant.Test.ComprehensiveAPI
53
50
@@ -134,9 +131,10 @@ successSpec = beforeAll (startWaiApp server) $ afterAll endWaiApp $ do
134
131
res <- runClient getUVerbRespHeaders baseUrl
135
132
case res of
136
133
Left e -> assertFailure $ show e
137
- Right (Z (I (WithStatus val))) ->
138
- getHeaders val `shouldBe` [(" X-Example1" , " 1729" ), (" X-Example2" , " eg2" )]
139
- Right (S _) -> assertFailure " expected first alternative of union"
134
+ Right val -> case matchUnion val of
135
+ Just (WithStatus val' :: WithStatus 200 (Headers TestHeaders Bool ))
136
+ -> getHeaders val' `shouldBe` [(" X-Example1" , " 1729" ), (" X-Example2" , " eg2" )]
137
+ Nothing -> assertFailure " unexpected alternative of union"
140
138
141
139
it " Stores Cookie in CookieJar after a redirect" $ \ (_, baseUrl) -> do
142
140
mgr <- C. newManager C. defaultManagerSettings
0 commit comments