diff options
Diffstat (limited to 'test/httptest.lua')
| -rw-r--r-- | test/httptest.lua | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/httptest.lua b/test/httptest.lua index c05b4cc..92528b2 100644 --- a/test/httptest.lua +++ b/test/httptest.lua | |||
| @@ -22,7 +22,8 @@ http.TIMEOUT = 10 | |||
| 22 | 22 | ||
| 23 | local t = socket.gettime() | 23 | local t = socket.gettime() |
| 24 | 24 | ||
| 25 | host = host or "diego.student.princeton.edu" | 25 | --host = host or "diego.student.princeton.edu" |
| 26 | host = host or "dell-diego" | ||
| 26 | proxy = proxy or "http://localhost:3128" | 27 | proxy = proxy or "http://localhost:3128" |
| 27 | prefix = prefix or "/luasocket-test" | 28 | prefix = prefix or "/luasocket-test" |
| 28 | cgiprefix = cgiprefix or "/luasocket-test-cgi" | 29 | cgiprefix = cgiprefix or "/luasocket-test-cgi" |
| @@ -125,6 +126,20 @@ assert(r == nil and e == re, tostring(r) ..", " .. tostring(re) .. | |||
| 125 | " vs " .. tostring(e)) | 126 | " vs " .. tostring(e)) |
| 126 | print("ok") | 127 | print("ok") |
| 127 | 128 | ||
| 129 | io.write("testing invalid empty port: ") | ||
| 130 | request = { | ||
| 131 | url = "http://" .. host .. ":" .. prefix .. "/index.html" | ||
| 132 | } | ||
| 133 | expect = { | ||
| 134 | body = index, | ||
| 135 | code = 200 | ||
| 136 | } | ||
| 137 | ignore = { | ||
| 138 | status = 1, | ||
| 139 | headers = 1 | ||
| 140 | } | ||
| 141 | check_request(request, expect, ignore) | ||
| 142 | |||
| 128 | ------------------------------------------------------------------------ | 143 | ------------------------------------------------------------------------ |
| 129 | io.write("testing post method: ") | 144 | io.write("testing post method: ") |
| 130 | -- wanted to test chunked post, but apache doesn't support it... | 145 | -- wanted to test chunked post, but apache doesn't support it... |
