mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-25 12:08:21 +01:00
Unix domain tests still broken.
This commit is contained in:
parent
5eefc73b57
commit
ebde49944b
@ -1,7 +1,7 @@
|
|||||||
require"socket"
|
local socket = require"socket"
|
||||||
local socket = require"socket.unix"
|
socket.unix = require"socket.unix"
|
||||||
|
|
||||||
host = "luasocket"
|
host = host or "luasocket"
|
||||||
|
|
||||||
function pass(...)
|
function pass(...)
|
||||||
local s = string.format(...)
|
local s = string.format(...)
|
||||||
@ -82,7 +82,7 @@ function check_timeout(tm, sl, elapsed, err, opp, mode, alldone)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if not socket.DEBUG then
|
if not socket._DEBUG then
|
||||||
fail("Please define LUASOCKET_DEBUG and recompile LuaSocket")
|
fail("Please define LUASOCKET_DEBUG and recompile LuaSocket")
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ else pass("connected!") end
|
|||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
function test_methods(sock, methods)
|
function test_methods(sock, methods)
|
||||||
for _, v in methods do
|
for _, v in pairs(methods) do
|
||||||
if type(sock[v]) ~= "function" then
|
if type(sock[v]) ~= "function" then
|
||||||
fail(sock.class .. " method '" .. v .. "' not registered")
|
fail(sock.class .. " method '" .. v .. "' not registered")
|
||||||
end
|
end
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
require("socket");
|
socket=require("socket");
|
||||||
os.remove("/tmp/luasocket")
|
os.remove("/tmp/luasocket")
|
||||||
socket = require("socket.unix");
|
socket.unix = require("socket.unix");
|
||||||
host = "luasocket";
|
host = host or "luasocket";
|
||||||
server = socket.unix()
|
server = assert(socket.unix())
|
||||||
print(server:bind(host))
|
assert(server:bind(host))
|
||||||
print(server:listen(5))
|
assert(server:listen(5))
|
||||||
ack = "\n";
|
ack = "\n";
|
||||||
while 1 do
|
while 1 do
|
||||||
print("server: waiting for client connection...");
|
print("server: waiting for client connection...");
|
||||||
@ -12,6 +12,6 @@ while 1 do
|
|||||||
while 1 do
|
while 1 do
|
||||||
command = assert(control:receive());
|
command = assert(control:receive());
|
||||||
assert(control:send(ack));
|
assert(control:send(ack));
|
||||||
(loadstring(command))();
|
((loadstring or load)(command))();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user