aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-07-02 18:44:05 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-07-02 18:44:05 +0000
commitb1a4ad2b1996936744c679e6ae563986ff701a3a (patch)
treec446d3bf2fe5bb0452027ee93388e505c2dfa53d /test
parent63807d647624df155a81a2b323f370e2c36192f6 (diff)
downloadluasocket-b1a4ad2b1996936744c679e6ae563986ff701a3a.tar.gz
luasocket-b1a4ad2b1996936744c679e6ae563986ff701a3a.tar.bz2
luasocket-b1a4ad2b1996936744c679e6ae563986ff701a3a.zip
Compiles and runs on windows.
Diffstat (limited to 'test')
-rw-r--r--test/mimetest.lua2
-rw-r--r--test/testclnt.lua22
2 files changed, 23 insertions, 1 deletions
diff --git a/test/mimetest.lua b/test/mimetest.lua
index 0b3db33..413a83b 100644
--- a/test/mimetest.lua
+++ b/test/mimetest.lua
@@ -8,7 +8,7 @@ local qptest = "qptest.bin"
8local eqptest = "qptest.bin2" 8local eqptest = "qptest.bin2"
9local dqptest = "qptest.bin3" 9local dqptest = "qptest.bin3"
10 10
11local b64test = "luasocket.dylib" 11local b64test = "luasocket.dll"
12local eb64test = "b64test.bin" 12local eb64test = "b64test.bin"
13local db64test = "b64test.bin2" 13local db64test = "b64test.bin2"
14 14
diff --git a/test/testclnt.lua b/test/testclnt.lua
index 38dc19a..cdd2c08 100644
--- a/test/testclnt.lua
+++ b/test/testclnt.lua
@@ -438,6 +438,25 @@ function rebind_test()
438end 438end
439 439
440------------------------------------------------------------------------ 440------------------------------------------------------------------------
441function getstats_test()
442 reconnect()
443 local t = 0
444 for i = 1, 25 do
445 local c = math.random(1, 100)
446 remote (string.format ([[
447 str = data:receive(%d)
448 data:send(str)
449 ]], c))
450 c:send(string.rep("a", c))
451 c:receive(c)
452 local r, s, a = c:getstats()
453 assert(r == t, "received count failed")
454 assert(s == t, "sent count failed")
455 end
456 print("ok")
457end
458
459------------------------------------------------------------------------
441test("method registration") 460test("method registration")
442test_methods(socket.tcp(), { 461test_methods(socket.tcp(), {
443 "accept", 462 "accept",
@@ -499,6 +518,9 @@ test("accept function: ")
499accept_timeout() 518accept_timeout()
500accept_errors() 519accept_errors()
501 520
521test("getstats test")
522getstats_test()
523
502test("character line") 524test("character line")
503test_asciiline(1) 525test_asciiline(1)
504test_asciiline(17) 526test_asciiline(17)