aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDiego Nehab <diego@impa.br>2013-05-30 17:59:28 +0800
committerDiego Nehab <diego@impa.br>2013-05-30 17:59:28 +0800
commitebde49944b1ba06153fe31a1ad92aaebf6e053e2 (patch)
tree35f1518488bd7bba54acf71110f1138ab9a15ba7 /test
parent5eefc73b572e591bd127b8c2873f0fa9522dc0b9 (diff)
downloadluasocket-ebde49944b1ba06153fe31a1ad92aaebf6e053e2.tar.gz
luasocket-ebde49944b1ba06153fe31a1ad92aaebf6e053e2.tar.bz2
luasocket-ebde49944b1ba06153fe31a1ad92aaebf6e053e2.zip
Unix domain tests still broken.
Diffstat (limited to 'test')
-rw-r--r--test/utestclnt.lua10
-rw-r--r--test/utestsrvr.lua14
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 @@
1require"socket" 1local socket = require"socket"
2local socket = require"socket.unix" 2socket.unix = require"socket.unix"
3 3
4host = "luasocket" 4host = host or "luasocket"
5 5
6function pass(...) 6function 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
83end 83end
84 84
85if not socket.DEBUG then 85if not socket._DEBUG then
86 fail("Please define LUASOCKET_DEBUG and recompile LuaSocket") 86 fail("Please define LUASOCKET_DEBUG and recompile LuaSocket")
87end 87end
88 88
@@ -115,7 +115,7 @@ else pass("connected!") end
115 115
116------------------------------------------------------------------------ 116------------------------------------------------------------------------
117function test_methods(sock, methods) 117function 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 @@
1require("socket"); 1socket=require("socket");
2os.remove("/tmp/luasocket") 2os.remove("/tmp/luasocket")
3socket = require("socket.unix"); 3socket.unix = require("socket.unix");
4host = "luasocket"; 4host = host or "luasocket";
5server = socket.unix() 5server = assert(socket.unix())
6print(server:bind(host)) 6assert(server:bind(host))
7print(server:listen(5)) 7assert(server:listen(5))
8ack = "\n"; 8ack = "\n";
9while 1 do 9while 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
17end 17end