on master help sign in
checking also Content-Range in tests.
commit8c708672c2ba0dfcc8b83e1e3d039b39dacb2bfd authorKazu Yamamoto <kazu@iij.ad.jp> dateThu 31 Oct 2013, 11:08 (13 years ago) parent56872f5
1 file changed+2−1
warp/test/ResponseSpec.hs+2−1
warp/test/ResponseSpec.hs+2−1
@@ -57,6 +57,7 @@ testPartial size offset count out = it title $ withApp defaultSettings app $ \po
5757 out `shouldBe` last bss
5858 let hs = mapMaybe toHeader bss
5959 lookup "Content-Length" hs `shouldBe` Just (show $ length $ last bss)
60+ lookup "Content-Range" hs `shouldBe` Just range
6061 where
6162 app _ = return $ responseFile status200 [] "attic/hex" $ Just $ FilePart offset count size
6263 title = show (offset, count, out)
@@ -64,7 +65,7 @@ testPartial size offset count out = it title $ withApp defaultSettings app $ \po
6465 case break (== ':') s of
6566 (x, ':':y) -> Just (x, dropWhile (== ' ') y)
6667 _ -> Nothing
67−
68+ range = "bytes " ++ show offset ++ "-" ++ show (offset + count - 1) ++ "/" ++ show size
6869spec :: Spec
6970spec = do
7071 describe "range requests" $ do