aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2011-08-08 16:23:06 -0700
committerSam Roberts <vieuxtech@gmail.com>2012-04-11 13:45:59 -0700
commit3b19f2a7edbcde798a9cf5f1f6175d360e891744 (patch)
treed9fa4a577a8e346bbdbc8050d1994a6c187fdfb1
parentdace50628c5acc0aad94538eb6d3bd31e055d941 (diff)
downloadluasocket-3b19f2a7edbcde798a9cf5f1f6175d360e891744.tar.gz
luasocket-3b19f2a7edbcde798a9cf5f1f6175d360e891744.tar.bz2
luasocket-3b19f2a7edbcde798a9cf5f1f6175d360e891744.zip
testsrvr asserts when test finishes successfully.
When the test client finishes, the test server asserts with a "closed" message. After looking carefully at this, I think the tests are running successfully and passing. Since it appears to be a test failure, I modified the server to allow the client to close the control connection.
-rw-r--r--test/testsrvr.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/testsrvr.lua b/test/testsrvr.lua
index f1972c2..4be4069 100644
--- a/test/testsrvr.lua
+++ b/test/testsrvr.lua
@@ -7,7 +7,12 @@ while 1 do
7 print("server: waiting for client connection..."); 7 print("server: waiting for client connection...");
8 control = assert(server:accept()); 8 control = assert(server:accept());
9 while 1 do 9 while 1 do
10 command = assert(control:receive()); 10 command, emsg = control:receive();
11 if emsg == "closed" then
12 control:close()
13 break
14 end
15 assert(command, emsg)
11 assert(control:send(ack)); 16 assert(control:send(ack));
12 print(command); 17 print(command);
13 (loadstring(command))(); 18 (loadstring(command))();