Fix test compilation

This commit is contained in:
Michael Snoyman 2017-04-12 13:47:16 +03:00
parent 89c5834ba8
commit 925023c9a1
No known key found for this signature in database
GPG Key ID: A048E8C057E86876

View File

@ -63,29 +63,29 @@ spec = do
describe "headerLines" $ do
it "can handle a nomarl case" $ do
src <- mkSourceFunc ["Status: 200\r\nContent-Type: text/plain\r\n\r\n"] >>= mkSource
x <- headerLines src
x <- headerLines True src
x `shouldBe` ["Status: 200", "Content-Type: text/plain"]
it "can handle a nasty case (1)" $ do
src <- mkSourceFunc ["Status: 200", "\r\nContent-Type: text/plain", "\r\n\r\n"] >>= mkSource
x <- headerLines src
x <- headerLines True src
x `shouldBe` ["Status: 200", "Content-Type: text/plain"]
it "can handle a nasty case (1)" $ do
src <- mkSourceFunc ["Status: 200", "\r", "\nContent-Type: text/plain", "\r", "\n\r\n"] >>= mkSource
x <- headerLines src
x <- headerLines True src
x `shouldBe` ["Status: 200", "Content-Type: text/plain"]
it "can handle a nasty case (1)" $ do
src <- mkSourceFunc ["Status: 200", "\r", "\n", "Content-Type: text/plain", "\r", "\n", "\r", "\n"] >>= mkSource
x <- headerLines src
x <- headerLines True src
x `shouldBe` ["Status: 200", "Content-Type: text/plain"]
it "can handle an illegal case (1)" $ do
src <- mkSourceFunc ["\nStatus:", "\n 200", "\nContent-Type: text/plain", "\r\n\r\n"] >>= mkSource
x <- headerLines src
x <- headerLines True src
x `shouldBe` []
y <- headerLines src
y <- headerLines True src
y `shouldBe` ["Status: 200", "Content-Type: text/plain"]
where
@ -111,7 +111,7 @@ headerLinesList' orig = do
writeIORef ref z
return y
src' <- mkSource src
res <- headerLines src'
res <- headerLines True src'
return (res, src')
consumeLen :: Int -> Source -> IO S8.ByteString