on master help sign in
Update tests to account for Accept-Ranges moving to fileRange
e3edfceAndrew Pritchard
warp/test/ResponseSpec.hs+7−7
@@ -99,7 +99,7 @@ spec = do
99 testFileRange
99 testFileRange
100 "gets a file size from file system"
100 "gets a file size from file system"
101 status200 [] "attic/hex" Nothing Nothing
101 status200 [] "attic/hex" Nothing Nothing
102− $ Right (status200,[("Content-Length","16")],0,16)
102+ $ Right (status200,[("Content-Length","16"), ("Accept-Ranges","bytes")],0,16)
103 testFileRange
103 testFileRange
104 "gets an error if a file does not exist"
104 "gets an error if a file does not exist"
105 status200 [] "attic/nonexist" Nothing Nothing
105 status200 [] "attic/nonexist" Nothing Nothing
@@ -107,24 +107,24 @@ spec = do
107 testFileRange
107 testFileRange
108 "changes status if FileParts is specified"
108 "changes status if FileParts is specified"
109 status200 [] "attic/hex" (Just (FilePart 2 10 16)) Nothing
109 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)
111 testFileRange
111 testFileRange
112 "does not change status and does not add Content-Range if FileParts means the entire"
112 "does not change status and does not add Content-Range if FileParts means the entire"
113 status200 [] "attic/hex" (Just (FilePart 0 16 16)) Nothing
113 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)
115 testFileRange
115 testFileRange
116 "gets a file size from file system and handles Range and returns Partical Content"
116 "gets a file size from file system and handles Range and returns Partical Content"
117 status200 [] "attic/hex" Nothing (Just "bytes=2-14")
117 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)
119 testFileRange
119 testFileRange
120 "truncates end point of range to file size"
120 "truncates end point of range to file size"
121 status200 [] "attic/hex" Nothing (Just "bytes=10-20")
121 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)
123 testFileRange
123 testFileRange
124 "gets a file size from file system and handles Range and returns OK if Range means the entire"
124 "gets a file size from file system and handles Range and returns OK if Range means the entire"
125 status200 [] "attic/hex" Nothing (Just "bytes=0-15")
125 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)
127 testFileRange
127 testFileRange
128 "igores Range if FilePart is specified"
128 "igores Range if FilePart is specified"
129 status200 [] "attic/hex" (Just (FilePart 2 10 16)) (Just "bytes=8-9")
129 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)