Merge branch 'tests52' of https://github.com/Florob/luasocket into Florob-tests52

master
Diego Nehab 2012-05-01 16:12:16 +08:00
commit af55d25675
2 changed files with 14 additions and 6 deletions

View File

@ -617,13 +617,16 @@ end
------------------------------------------------------------------------ ------------------------------------------------------------------------
test("method registration") test("method registration")
test_methods(socket.tcp(), {
local tcp_methods = {
"accept", "accept",
"bind", "bind",
"close", "close",
"connect", "connect",
"dirty", "dirty",
"getfamily",
"getfd", "getfd",
"getoption",
"getpeername", "getpeername",
"getsockname", "getsockname",
"getstats", "getstats",
@ -637,13 +640,16 @@ test_methods(socket.tcp(), {
"setsockname", "setsockname",
"settimeout", "settimeout",
"shutdown", "shutdown",
}) }
test_methods(socket.tcp(), tcp_methods)
test_methods(socket.tcp6(), tcp_methods)
test_methods(socket.udp(), { local udp_methods = {
"close", "close",
"getpeername",
"dirty", "dirty",
"getfamily",
"getfd", "getfd",
"getoption",
"getpeername", "getpeername",
"getsockname", "getsockname",
"receive", "receive",
@ -655,7 +661,9 @@ test_methods(socket.udp(), {
"setpeername", "setpeername",
"setsockname", "setsockname",
"settimeout" "settimeout"
}) }
test_methods(socket.udp(), udp_methods)
test_methods(socket.udp6(), udp_methods)
test("partial receive") test("partial receive")
test_partialrecv() test_partialrecv()

View File

@ -15,6 +15,6 @@ while 1 do
assert(command, emsg) assert(command, emsg)
assert(control:send(ack)); assert(control:send(ack));
print(command); print(command);
(load(command))(); ((loadstring or load)(command))();
end end
end end