on master help sign in
Update tests to account for Accept-Ranges moving to fileRange
commite3edfce2f75e7c37f8d14bc6ccc07aa30833d1ab authorAndrew Pritchard <awpr@google.com> dateSat 12 Sep 2015, 11:55 (11 years ago) parent71b82f4
1 file changed+7−7
warp/test/ResponseSpec.hs+7−7
warp/test/ResponseSpec.hs+7−7
@@ -99,7 +99,7 @@ spec = do
9999 testFileRange
100100 "gets a file size from file system"
101101 status200 [] "attic/hex" Nothing Nothing
102− $ Right (status200,[("Content-Length","16")],0,16)
102+ $ Right (status200,[("Content-Length","16"), ("Accept-Ranges","bytes")],0,16)
103103 testFileRange
104104 "gets an error if a file does not exist"
105105 status200 [] "attic/nonexist" Nothing Nothing
@@ -107,24 +107,24 @@ spec = do
107107 testFileRange
108108 "changes status if FileParts is specified"
109109 status200 [] "attic/hex" (Just (FilePart 2 10 16)) Nothing
110− $ Right (status206,[("Content-Range", "bytes 2-11/16"),("Content-Length","10")],2,10)
110+ $ Right (status206,[("Content-Range", "bytes 2-11/16"),("Content-Length","10"),("Accept-Ranges","bytes")],2,10)
111111 testFileRange
112112 "does not change status and does not add Content-Range if FileParts means the entire"
113113 status200 [] "attic/hex" (Just (FilePart 0 16 16)) Nothing
114− $ Right (status200,[("Content-Length","16")],0,16)
114+ $ Right (status200,[("Content-Length","16"), ("Accept-Ranges","bytes")],0,16)
115115 testFileRange
116116 "gets a file size from file system and handles Range and returns Partical Content"
117117 status200 [] "attic/hex" Nothing (Just "bytes=2-14")
118− $ Right (status206,[("Content-Range","bytes 2-14/16"),("Content-Length","13")],2,13)
118+ $ Right (status206,[("Content-Range","bytes 2-14/16"),("Content-Length","13"),("Accept-Ranges","bytes")],2,13)
119119 testFileRange
120120 "truncates end point of range to file size"
121121 status200 [] "attic/hex" Nothing (Just "bytes=10-20")
122− $ Right (status206,[("Content-Range","bytes 10-15/16"),("Content-Length","6")],10,6)
122+ $ Right (status206,[("Content-Range","bytes 10-15/16"),("Content-Length","6"),("Accept-Ranges","bytes")],10,6)
123123 testFileRange
124124 "gets a file size from file system and handles Range and returns OK if Range means the entire"
125125 status200 [] "attic/hex" Nothing (Just "bytes=0-15")
126− $ Right (status200,[("Content-Length","16")],0,16)
126+ $ Right (status200,[("Content-Length","16"),("Accept-Ranges","bytes")],0,16)
127127 testFileRange
128128 "igores Range if FilePart is specified"
129129 status200 [] "attic/hex" (Just (FilePart 2 10 16)) (Just "bytes=8-9")
130− $ Right (status206,[("Content-Range", "bytes 2-11/16"),("Content-Length","10")],2,10)
130+ $ Right (status206,[("Content-Range", "bytes 2-11/16"),("Content-Length","10"),("Accept-Ranges","bytes")],2,10)