on master help sign in
Newer WAI
commit8826c518cffa829c758c5673a745f3f44e2ea95f authorMichael Snoyman <michael@snoyman.com> dateThu 24 Mar 2011, 13:24 (16 years ago) parentbd7964f
2 files changed+9−9
Network/Wai/Test.hs+5−5 wai-test.cabal+4−4
Network/Wai/Test.hs+5−5
@@ -30,7 +30,7 @@ import Blaze.ByteString.Builder.Enumerator (builderToByteString)
3030import qualified Data.ByteString.Lazy as L
3131import qualified Data.ByteString.Lazy.Char8 as L8
3232import qualified Network.HTTP.Types as H
33−import qualified Data.Ascii as A
33+import Data.CaseInsensitive (CI)
3434
3535type Session = ReaderT Application (StateT ClientState IO)
3636
@@ -79,7 +79,7 @@ assertBool s b = liftIO $ H.assertBool s b
7979assertString :: String -> Session ()
8080assertString s = liftIO $ H.assertString s
8181
82−assertContentType :: A.Ascii -> SResponse -> Session ()
82+assertContentType :: ByteString -> SResponse -> Session ()
8383assertContentType ct SResponse{simpleHeaders = h} =
8484 case lookup "content-type" h of
8585 Nothing -> assertString $ concat
@@ -94,7 +94,7 @@ assertContentType ct SResponse{simpleHeaders = h} =
9494 , show ct'
9595 ]) (go ct == go ct')
9696 where
97− go = A.unsafeFromByteString . S8.takeWhile (/= ';') . A.toByteString
97+ go = S8.takeWhile (/= ';')
9898
9999assertStatus :: Int -> SResponse -> Session ()
100100assertStatus i SResponse{simpleStatus = s} = assertBool (concat
@@ -114,7 +114,7 @@ assertBody lbs SResponse{simpleBody = lbs'} = assertBool (concat
114114 , show $ L8.unpack lbs'
115115 ]) $ lbs == lbs'
116116
117−assertHeader :: A.CIAscii -> A.Ascii -> SResponse -> Session ()
117+assertHeader :: CI ByteString -> ByteString -> SResponse -> Session ()
118118assertHeader header value SResponse{simpleHeaders = h} =
119119 case lookup header h of
120120 Nothing -> assertString $ concat
@@ -133,7 +133,7 @@ assertHeader header value SResponse{simpleHeaders = h} =
133133 , show value'
134134 ]) (value == value')
135135
136−assertNoHeader :: A.CIAscii -> SResponse -> Session ()
136+assertNoHeader :: CI ByteString -> SResponse -> Session ()
137137assertNoHeader header SResponse{simpleHeaders = h} =
138138 case lookup header h of
139139 Nothing -> return ()
wai-test.cabal+4−4
@@ -15,15 +15,15 @@ library
1515 build-depends: base >= 4 && < 5
1616 , wai >= 0.4 && < 0.5
1717 , bytestring >= 0.9.1.4 && < 0.10
18− , blaze-builder >= 0.2.1 && < 0.3
18+ , blaze-builder >= 0.2.1 && < 0.4
1919 , transformers >= 0.2 && < 0.3
2020 , containers >= 0.2 && < 0.5
2121 , enumerator >= 0.4.7 && < 0.5
22− , cookie >= 0.1 && < 0.2
22+ , cookie >= 0.2 && < 0.3
2323 , blaze-builder-enumerator >= 0.2 && < 0.3
2424 , HUnit >= 1.2 && < 1.3
25− , http-types >= 0.5 && < 0.6
26− , ascii >= 0.0.2 && < 0.1
25+ , http-types >= 0.6 && < 0.7
26+ , case-insensitive >= 0.2 && < 0.3
2727 exposed-modules: Network.Wai.Test
2828 ghc-options: -Wall
2929