diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/testclnt.lua | 3 | ||||
| -rw-r--r-- | test/urltest.lua | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/test/testclnt.lua b/test/testclnt.lua index 83f925b..cf71c9f 100644 --- a/test/testclnt.lua +++ b/test/testclnt.lua | |||
| @@ -382,7 +382,8 @@ function connect_timeout() | |||
| 382 | assert(c, e) | 382 | assert(c, e) |
| 383 | c:settimeout(0.1) | 383 | c:settimeout(0.1) |
| 384 | local t = socket.gettime() | 384 | local t = socket.gettime() |
| 385 | local r, e = c:connect("127.0.0.2", 80) | 385 | local r, e = c:connect("10.0.0.1", 81) |
| 386 | print(r, e) | ||
| 386 | assert(not r, "should not connect") | 387 | assert(not r, "should not connect") |
| 387 | assert(socket.gettime() - t < 2, "took too long to give up.") | 388 | assert(socket.gettime() - t < 2, "took too long to give up.") |
| 388 | c:close() | 389 | c:close() |
diff --git a/test/urltest.lua b/test/urltest.lua index ae54db9..8dc0c14 100644 --- a/test/urltest.lua +++ b/test/urltest.lua | |||
| @@ -71,7 +71,7 @@ local check_parse_url = function(gaba) | |||
| 71 | local url = gaba.url | 71 | local url = gaba.url |
| 72 | gaba.url = nil | 72 | gaba.url = nil |
| 73 | local parsed = socket.url.parse(url) | 73 | local parsed = socket.url.parse(url) |
| 74 | for i, v in gaba do | 74 | for i, v in pairs(gaba) do |
| 75 | if v ~= parsed[i] then | 75 | if v ~= parsed[i] then |
| 76 | io.write("parse: In test for '", url, "' expected ", i, " = '", | 76 | io.write("parse: In test for '", url, "' expected ", i, " = '", |
| 77 | v, "' but got '", tostring(parsed[i]), "'\n") | 77 | v, "' but got '", tostring(parsed[i]), "'\n") |
| @@ -79,7 +79,7 @@ local check_parse_url = function(gaba) | |||
| 79 | exit() | 79 | exit() |
| 80 | end | 80 | end |
| 81 | end | 81 | end |
| 82 | for i, v in parsed do | 82 | for i, v in pairs(parsed) do |
| 83 | if v ~= gaba[i] then | 83 | if v ~= gaba[i] then |
| 84 | io.write("parse: In test for '", url, "' expected ", i, " = '", | 84 | io.write("parse: In test for '", url, "' expected ", i, " = '", |
| 85 | tostring(gaba[i]), "' but got '", v, "'\n") | 85 | tostring(gaba[i]), "' but got '", v, "'\n") |
