Stupid bug in http.lua.
This commit is contained in:
parent
b22f6f3830
commit
8b114f3bf4
12 changed files with 78 additions and 73 deletions
|
@ -1,3 +1,3 @@
|
|||
local dict = require"socket.dict"
|
||||
|
||||
for i,v in dict.get("dict://localhost/d:teste") do print(v) end
|
||||
for i,v in pairs(dict.get("dict://localhost/d:teste")) do print(v) end
|
||||
|
|
|
@ -32,7 +32,7 @@ index_file = "test/index.html"
|
|||
index = readfile(index_file)
|
||||
|
||||
local check_result = function(response, expect, ignore)
|
||||
for i,v in response do
|
||||
for i,v in pairs(response) do
|
||||
if not ignore[i] then
|
||||
if v ~= expect[i] then
|
||||
local f = io.open("err", "w")
|
||||
|
@ -42,7 +42,7 @@ local check_result = function(response, expect, ignore)
|
|||
end
|
||||
end
|
||||
end
|
||||
for i,v in expect do
|
||||
for i,v in pairs(expect) do
|
||||
if not ignore[i] then
|
||||
if v ~= response[i] then
|
||||
local f = io.open("err", "w")
|
||||
|
|
|
@ -70,7 +70,7 @@ end
|
|||
local check_headers = function(sent, got)
|
||||
sent = sent or {}
|
||||
got = got or {}
|
||||
for i,v in sent do
|
||||
for i,v in pairs(sent) do
|
||||
if not similar(v, got[i]) then fail("header " .. v .. "failed!") end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -75,7 +75,7 @@ local check_parse_url = function(gaba)
|
|||
if v ~= parsed[i] then
|
||||
io.write("parse: In test for '", url, "' expected ", i, " = '",
|
||||
v, "' but got '", tostring(parsed[i]), "'\n")
|
||||
for i,v in parsed do print(i,v) end
|
||||
for i,v in pairs(parsed) do print(i,v) end
|
||||
exit()
|
||||
end
|
||||
end
|
||||
|
@ -83,7 +83,7 @@ local check_parse_url = function(gaba)
|
|||
if v ~= gaba[i] then
|
||||
io.write("parse: In test for '", url, "' expected ", i, " = '",
|
||||
tostring(gaba[i]), "' but got '", v, "'\n")
|
||||
for i,v in parsed do print(i,v) end
|
||||
for i,v in pairs(parsed) do print(i,v) end
|
||||
exit()
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue