wai-extra 3.0.31 → 3.0.32
raw patch · 3 files changed
+17/−15 lines, 3 filesdep −call-stack
Dependencies removed: call-stack
Files
- ChangeLog.md +4/−0
- Network/Wai/Test.hs +12/−13
- wai-extra.cabal +1/−2
ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for wai-extra +## 3.0.32++* Undo previous two release, restore code from 3.0.29.2+ ## 3.0.31 * Undo WaiTestFailure change in previous release
Network/Wai/Test.hs view
@@ -62,7 +62,6 @@ import qualified Data.Text.Encoding as TE import Data.IORef import Data.Time.Clock (getCurrentTime)-import Data.CallStack (HasCallStack) -- | --@@ -207,20 +206,20 @@ where (s, h, withBody) = responseToStream res -assertBool :: HasCallStack => String -> Bool -> Session ()+assertBool :: String -> Bool -> Session () assertBool s b = unless b $ assertFailure s -assertString :: HasCallStack => String -> Session ()+assertString :: String -> Session () assertString s = unless (null s) $ assertFailure s -assertFailure :: HasCallStack => String -> Session ()+assertFailure :: String -> Session () assertFailure msg = msg `deepseq` liftIO (throwIO (WaiTestFailure msg)) data WaiTestFailure = WaiTestFailure String deriving (Show, Eq, Typeable) instance Exception WaiTestFailure -assertContentType :: HasCallStack => ByteString -> SResponse -> Session ()+assertContentType :: ByteString -> SResponse -> Session () assertContentType ct SResponse{simpleHeaders = h} = case lookup "content-type" h of Nothing -> assertString $ concat@@ -237,7 +236,7 @@ where go = S8.takeWhile (/= ';') -assertStatus :: HasCallStack => Int -> SResponse -> Session ()+assertStatus :: Int -> SResponse -> Session () assertStatus i SResponse{simpleStatus = s} = assertBool (concat [ "Expected status code " , show i@@ -247,7 +246,7 @@ where sc = H.statusCode s -assertBody :: HasCallStack => L.ByteString -> SResponse -> Session ()+assertBody :: L.ByteString -> SResponse -> Session () assertBody lbs SResponse{simpleBody = lbs'} = assertBool (concat [ "Expected response body " , show $ L8.unpack lbs@@ -255,7 +254,7 @@ , show $ L8.unpack lbs' ]) $ lbs == lbs' -assertBodyContains :: HasCallStack => L.ByteString -> SResponse -> Session ()+assertBodyContains :: L.ByteString -> SResponse -> Session () assertBodyContains lbs SResponse{simpleBody = lbs'} = assertBool (concat [ "Expected response body to contain " , show $ L8.unpack lbs@@ -265,7 +264,7 @@ where strict = S.concat . L.toChunks -assertHeader :: HasCallStack => CI ByteString -> ByteString -> SResponse -> Session ()+assertHeader :: CI ByteString -> ByteString -> SResponse -> Session () assertHeader header value SResponse{simpleHeaders = h} = case lookup header h of Nothing -> assertString $ concat@@ -284,7 +283,7 @@ , show value' ]) (value == value') -assertNoHeader :: HasCallStack => CI ByteString -> SResponse -> Session ()+assertNoHeader :: CI ByteString -> SResponse -> Session () assertNoHeader header SResponse{simpleHeaders = h} = case lookup header h of Nothing -> return ()@@ -298,7 +297,7 @@ -- | -- -- Since 3.0.6-assertClientCookieExists :: HasCallStack => String -> ByteString -> Session ()+assertClientCookieExists :: String -> ByteString -> Session () assertClientCookieExists s cookieName = do cookies <- getClientCookies assertBool s $ Map.member cookieName cookies@@ -306,7 +305,7 @@ -- | -- -- Since 3.0.6-assertNoClientCookieExists :: HasCallStack => String -> ByteString -> Session ()+assertNoClientCookieExists :: String -> ByteString -> Session () assertNoClientCookieExists s cookieName = do cookies <- getClientCookies assertBool s $ not $ Map.member cookieName cookies@@ -314,7 +313,7 @@ -- | -- -- Since 3.0.6-assertClientCookieValue :: HasCallStack => String -> ByteString -> ByteString -> Session ()+assertClientCookieValue :: String -> ByteString -> ByteString -> Session () assertClientCookieValue s cookieName cookieValue = do cookies <- getClientCookies case Map.lookup cookieName cookies of
wai-extra.cabal view
@@ -1,5 +1,5 @@ Name: wai-extra-Version: 3.0.31+Version: 3.0.32 Synopsis: Provides some basic WAI handlers and middleware. description: Provides basic WAI handler and middleware functionality:@@ -116,7 +116,6 @@ , aeson , iproute , http2- , call-stack if os(windows) cpp-options: -DWINDOWS