diff options
author | Diego Nehab <diego@impa.br> | 2013-05-30 17:59:28 +0800 |
---|---|---|
committer | Diego Nehab <diego@impa.br> | 2013-05-30 17:59:28 +0800 |
commit | ebde49944b1ba06153fe31a1ad92aaebf6e053e2 (patch) | |
tree | 35f1518488bd7bba54acf71110f1138ab9a15ba7 /test | |
parent | 5eefc73b572e591bd127b8c2873f0fa9522dc0b9 (diff) | |
download | luasocket-ebde49944b1ba06153fe31a1ad92aaebf6e053e2.tar.gz luasocket-ebde49944b1ba06153fe31a1ad92aaebf6e053e2.tar.bz2 luasocket-ebde49944b1ba06153fe31a1ad92aaebf6e053e2.zip |
Unix domain tests still broken.
Diffstat (limited to 'test')
-rw-r--r-- | test/utestclnt.lua | 10 | ||||
-rw-r--r-- | test/utestsrvr.lua | 14 |
2 files changed, 12 insertions, 12 deletions
diff --git a/test/utestclnt.lua b/test/utestclnt.lua index 01f55e5..34a0718 100644 --- a/test/utestclnt.lua +++ b/test/utestclnt.lua | |||
@@ -1,7 +1,7 @@ | |||
1 | require"socket" | 1 | local socket = require"socket" |
2 | local socket = require"socket.unix" | 2 | socket.unix = require"socket.unix" |
3 | 3 | ||
4 | host = "luasocket" | 4 | host = host or "luasocket" |
5 | 5 | ||
6 | function pass(...) | 6 | function pass(...) |
7 | local s = string.format(...) | 7 | local s = string.format(...) |
@@ -82,7 +82,7 @@ function check_timeout(tm, sl, elapsed, err, opp, mode, alldone) | |||
82 | end | 82 | end |
83 | end | 83 | end |
84 | 84 | ||
85 | if not socket.DEBUG then | 85 | if not socket._DEBUG then |
86 | fail("Please define LUASOCKET_DEBUG and recompile LuaSocket") | 86 | fail("Please define LUASOCKET_DEBUG and recompile LuaSocket") |
87 | end | 87 | end |
88 | 88 | ||
@@ -115,7 +115,7 @@ else pass("connected!") end | |||
115 | 115 | ||
116 | ------------------------------------------------------------------------ | 116 | ------------------------------------------------------------------------ |
117 | function test_methods(sock, methods) | 117 | function test_methods(sock, methods) |
118 | for _, v in methods do | 118 | for _, v in pairs(methods) do |
119 | if type(sock[v]) ~= "function" then | 119 | if type(sock[v]) ~= "function" then |
120 | fail(sock.class .. " method '" .. v .. "' not registered") | 120 | fail(sock.class .. " method '" .. v .. "' not registered") |
121 | end | 121 | end |
diff --git a/test/utestsrvr.lua b/test/utestsrvr.lua index f7be196..a96b570 100644 --- a/test/utestsrvr.lua +++ b/test/utestsrvr.lua | |||
@@ -1,10 +1,10 @@ | |||
1 | require("socket"); | 1 | socket=require("socket"); |
2 | os.remove("/tmp/luasocket") | 2 | os.remove("/tmp/luasocket") |
3 | socket = require("socket.unix"); | 3 | socket.unix = require("socket.unix"); |
4 | host = "luasocket"; | 4 | host = host or "luasocket"; |
5 | server = socket.unix() | 5 | server = assert(socket.unix()) |
6 | print(server:bind(host)) | 6 | assert(server:bind(host)) |
7 | print(server:listen(5)) | 7 | assert(server:listen(5)) |
8 | ack = "\n"; | 8 | ack = "\n"; |
9 | while 1 do | 9 | while 1 do |
10 | print("server: waiting for client connection..."); | 10 | print("server: waiting for client connection..."); |
@@ -12,6 +12,6 @@ while 1 do | |||
12 | while 1 do | 12 | while 1 do |
13 | command = assert(control:receive()); | 13 | command = assert(control:receive()); |
14 | assert(control:send(ack)); | 14 | assert(control:send(ack)); |
15 | (loadstring(command))(); | 15 | ((loadstring or load)(command))(); |
16 | end | 16 | end |
17 | end | 17 | end |