diff options
Diffstat (limited to 'test/testclnt.lua')
-rw-r--r-- | test/testclnt.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/testclnt.lua b/test/testclnt.lua index 6735113..da6b2e8 100644 --- a/test/testclnt.lua +++ b/test/testclnt.lua | |||
@@ -339,12 +339,14 @@ end | |||
339 | ------------------------------------------------------------------------ | 339 | ------------------------------------------------------------------------ |
340 | function test_selectbugs() | 340 | function test_selectbugs() |
341 | local r, s, e = socket.select(nil, nil, 0.1) | 341 | local r, s, e = socket.select(nil, nil, 0.1) |
342 | assert(type(r) == "table" and type(s) == "table" and e == "timeout") | 342 | assert(type(r) == "table" and type(s) == "table" and |
343 | (e == "timeout" or e == "error")) | ||
343 | pass("both nil: ok") | 344 | pass("both nil: ok") |
344 | local udp = socket.udp() | 345 | local udp = socket.udp() |
345 | udp:close() | 346 | udp:close() |
346 | r, s, e = socket.select({ udp }, { udp }, 0.1) | 347 | r, s, e = socket.select({ udp }, { udp }, 0.1) |
347 | assert(type(r) == "table" and type(s) == "table" and e == "timeout") | 348 | assert(type(r) == "table" and type(s) == "table" and |
349 | (e == "timeout" or e == "error")) | ||
348 | pass("closed sockets: ok") | 350 | pass("closed sockets: ok") |
349 | e = pcall(socket.select, "wrong", 1, 0.1) | 351 | e = pcall(socket.select, "wrong", 1, 0.1) |
350 | assert(e == false) | 352 | assert(e == false) |