servant/servant-client/test/Servant/Client/PerformRequest/BaseSpec.hs
Sönke Hahn d46a41662e wip
2016-01-04 16:49:47 +01:00

20 lines
581 B
Haskell

{-# LANGUAGE OverloadedStrings #-}
module Servant.Client.PerformRequest.BaseSpec where
import Test.Hspec
import Servant.Client.PerformRequest.Base
spec :: Spec
spec = do
describe "parseHeaders" $ do
it "parses single headers" $ do
parseHeaders "key: value" `shouldBe` [("key", "value")]
it "parses multiple headers" $ do
parseHeaders "foo: bar\r\nnext: yay" `shouldBe`
[("foo", "bar"), ("next", "yay")]
it "handles colons in header values correctly" $ do
parseHeaders "foo: bar:baz" `shouldBe` [("foo", "bar:baz")]