aboutsummaryrefslogtreecommitdiff
path: root/test/httptest.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/httptest.lua')
-rw-r--r--test/httptest.lua19
1 files changed, 10 insertions, 9 deletions
diff --git a/test/httptest.lua b/test/httptest.lua
index 31e8212..ce7a93b 100644
--- a/test/httptest.lua
+++ b/test/httptest.lua
@@ -116,6 +116,16 @@ ignore = {
116check_request(request, expect, ignore) 116check_request(request, expect, ignore)
117 117
118------------------------------------------------------------------------ 118------------------------------------------------------------------------
119io.write("testing invalid url: ")
120local c, e = socket.connect("", 80)
121local r, re = http.request{url = host .. prefix}
122assert(r == nil and e == re)
123r, re = http.request(host .. prefix)
124assert(r == nil and e == re, tostring(r) ..", " .. tostring(re) ..
125 " vs " .. tostring(e))
126print("ok")
127
128------------------------------------------------------------------------
119io.write("testing post method: ") 129io.write("testing post method: ")
120-- wanted to test chunked post, but apache doesn't support it... 130-- wanted to test chunked post, but apache doesn't support it...
121request = { 131request = {
@@ -407,15 +417,6 @@ assert(r == nil and e == re)
407print("ok") 417print("ok")
408 418
409------------------------------------------------------------------------ 419------------------------------------------------------------------------
410io.write("testing invalid url: ")
411local c, e = socket.connect("", 80)
412local r, re = http.request{url = host .. prefix}
413assert(r == nil and e == re)
414r, re = http.request(host .. prefix)
415assert(r == nil and e == re)
416print("ok")
417
418------------------------------------------------------------------------
419print("passed all tests") 420print("passed all tests")
420os.remove("err") 421os.remove("err")
421 422