aboutsummaryrefslogtreecommitdiff
path: root/test/testclnt.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/testclnt.lua')
-rw-r--r--test/testclnt.lua28
1 files changed, 19 insertions, 9 deletions
diff --git a/test/testclnt.lua b/test/testclnt.lua
index b2b4b18..e38c248 100644
--- a/test/testclnt.lua
+++ b/test/testclnt.lua
@@ -17,12 +17,14 @@ function warn(...)
17 io.write("WARNING: ", s, "\n") 17 io.write("WARNING: ", s, "\n")
18end 18end
19 19
20pad = string.rep(" ", 8192)
21
20function remote(...) 22function remote(...)
21 local s = string.format(unpack(arg)) 23 local s = string.format(unpack(arg))
22 s = string.gsub(s, "\n", ";") 24 s = string.gsub(s, "\n", ";")
23 s = string.gsub(s, "%s+", " ") 25 s = string.gsub(s, "%s+", " ")
24 s = string.gsub(s, "^%s*", "") 26 s = string.gsub(s, "^%s*", "")
25 control:send(s, "\n") 27 control:send(pad, s, "\n")
26 control:receive() 28 control:receive()
27end 29end
28 30
@@ -82,16 +84,19 @@ function reconnect()
82 remote [[ 84 remote [[
83 if data then data:close() data = nil end 85 if data then data:close() data = nil end
84 data = server:accept() 86 data = server:accept()
87 data:setoption("nodelay", true)
85 ]] 88 ]]
86 data, err = socket.connect(host, port) 89 data, err = socket.connect(host, port)
87 if not data then fail(err) 90 if not data then fail(err)
88 else pass("connected!") end 91 else pass("connected!") end
92 data:setoption("nodelay", true)
89end 93end
90 94
91pass("attempting control connection...") 95pass("attempting control connection...")
92control, err = socket.connect(host, port) 96control, err = socket.connect(host, port)
93if err then fail(err) 97if err then fail(err)
94else pass("connected!") end 98else pass("connected!") end
99control:setoption("nodelay", true)
95 100
96------------------------------------------------------------------------ 101------------------------------------------------------------------------
97test("method registration") 102test("method registration")
@@ -157,16 +162,21 @@ remote "data:send(str); data:close()"
157end 162end
158 163
159 164
160test_mixed(1) 165--test_mixed(1)
161test_mixed(17) 166--test_mixed(17)
162test_mixed(200) 167--test_mixed(200)
168--test_mixed(4091)
169--test_mixed(80199)
170--test_mixed(4091)
171--test_mixed(200)
172--test_mixed(17)
173--test_mixed(1)
174
175test_mixed(4091)
176test_mixed(4091)
177test_mixed(4091)
163test_mixed(4091) 178test_mixed(4091)
164test_mixed(80199)
165test_mixed(4091) 179test_mixed(4091)
166test_mixed(200)
167test_mixed(17)
168test_mixed(1)
169
170------------------------------------------------------------------------ 180------------------------------------------------------------------------
171test("character line") 181test("character line")
172reconnect() 182reconnect()