From 8d933916d82b2537817e9f0fb83a936404f7c86c Mon Sep 17 00:00:00 2001 From: moteus Date: Tue, 11 Jun 2013 15:36:53 +0400 Subject: [PATCH] Fix. test_socket_error --- test/test_socket_error.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/test_socket_error.lua b/test/test_socket_error.lua index 9bd0bc7..1b4b601 100644 --- a/test/test_socket_error.lua +++ b/test/test_socket_error.lua @@ -14,8 +14,12 @@ assert('timeout' == err) for i = 1, 10 do -- select pass even if socket has error local _, rec, err = socket.select(nil, {sock}, 1) - assert('timeout' == err) - assert(not next(rec)) + local _, ss = next(rec) + if ss then + assert(ss == sock) + else + assert('timeout' == err, 'unexpected error :' .. tostring(err)) + end err = sock:getoption("error") -- i get 'connection refused' on WinXP if err then print("Passed! Error is '" .. err .. "'.")