summaryrefslogtreecommitdiff
path: root/tests/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2020-09-25 00:33:07 +0800
committerruki <[email protected]>2020-09-25 00:33:07 +0800
commit90af4956738036172984f068502624bbc515cae7 (patch)
tree7cd7177becaf98e676ae8eaa478f042e14505d3a /tests/modules
parent700f08a7bae11c22295f884610f98b7b99eb1790 (diff)
fix trailing white-space
Diffstat (limited to 'tests/modules')
-rw-r--r--tests/modules/pipe/echo_server.lua2
-rw-r--r--tests/modules/pipe/sched_echo_server.lua2
-rw-r--r--tests/modules/scheduler/runjobs.lua2
-rw-r--r--tests/modules/scheduler/spinner.lua2
-rw-r--r--tests/modules/socket/sched_tcp/echo_server.lua10
-rw-r--r--tests/modules/socket/sched_tcp/file_server.lua8
-rw-r--r--tests/modules/socket/sched_udp/echo_server.lua2
-rw-r--r--tests/modules/socket/tcp/echo_server.lua6
-rw-r--r--tests/modules/socket/tcp/file_server.lua6
-rw-r--r--tests/modules/socket/udp/echo_server.lua2
-rw-r--r--tests/modules/socket/unix_tcp/echo_server.lua6
-rw-r--r--tests/modules/socket/unix_tcp/file_server.lua6
12 files changed, 27 insertions, 27 deletions
diff --git a/tests/modules/pipe/echo_server.lua b/tests/modules/pipe/echo_server.lua
index 15f15291b..9bf1cc8e2 100644
--- a/tests/modules/pipe/echo_server.lua
+++ b/tests/modules/pipe/echo_server.lua
@@ -4,7 +4,7 @@ function main(name)
local pipefile = pipe.open(name or "test", 'r')
if pipefile:connect() > 0 then
- print("%s: connected", pipefile)
+ print("%s: connected", pipefile)
local count = 0
local result = nil
while count < 10000 do
diff --git a/tests/modules/pipe/sched_echo_server.lua b/tests/modules/pipe/sched_echo_server.lua
index 8a5b0b2a9..6a89131d0 100644
--- a/tests/modules/pipe/sched_echo_server.lua
+++ b/tests/modules/pipe/sched_echo_server.lua
@@ -5,7 +5,7 @@ function _session(id)
local pipefile = pipe.open("test" .. id, 'r')
if pipefile:connect() > 0 then
- print("%s/%d: connected", pipefile, id)
+ print("%s/%d: connected", pipefile, id)
local count = 0
local result = nil
while count < 10000 do
diff --git a/tests/modules/scheduler/runjobs.lua b/tests/modules/scheduler/runjobs.lua
index 0742bbc2e..8659ef6ef 100644
--- a/tests/modules/scheduler/runjobs.lua
+++ b/tests/modules/scheduler/runjobs.lua
@@ -11,7 +11,7 @@ function _jobfunc(index, total)
end
function main()
-
+
-- test callback
print("==================================== test callback ====================================")
local t = os.mclock()
diff --git a/tests/modules/scheduler/spinner.lua b/tests/modules/scheduler/spinner.lua
index 14b871c7e..c48e7d5b7 100644
--- a/tests/modules/scheduler/spinner.lua
+++ b/tests/modules/scheduler/spinner.lua
@@ -2,7 +2,7 @@ import("private.async.runjobs")
function main()
printf("testing .. ")
- runjobs("test", function ()
+ runjobs("test", function ()
os.sleep(10000)
end, {progress = true})
print("ok")
diff --git a/tests/modules/socket/sched_tcp/echo_server.lua b/tests/modules/socket/sched_tcp/echo_server.lua
index 82a2044d8..d85a6fdb1 100644
--- a/tests/modules/socket/sched_tcp/echo_server.lua
+++ b/tests/modules/socket/sched_tcp/echo_server.lua
@@ -39,14 +39,14 @@ function _listen(addr, port)
local sock_clients = {}
local sock = socket.bind(addr, port)
sock:listen(100)
- print("%s: listening %s:%d ..", sock, addr, port)
- while true do
+ print("%s: listening %s:%d ..", sock, addr, port)
+ while true do
local sock_client = sock:accept()
if sock_client then
- print("%s: accepted", sock_client)
+ print("%s: accepted", sock_client)
table.insert(sock_clients, sock_client)
- scheduler.co_start(_session_recv, sock_client)
- scheduler.co_start(_session_send, sock_client)
+ scheduler.co_start(_session_recv, sock_client)
+ scheduler.co_start(_session_send, sock_client)
end
end
for _, sock_client in ipairs(sock_clients) do
diff --git a/tests/modules/socket/sched_tcp/file_server.lua b/tests/modules/socket/sched_tcp/file_server.lua
index c1ae25d33..983280117 100644
--- a/tests/modules/socket/sched_tcp/file_server.lua
+++ b/tests/modules/socket/sched_tcp/file_server.lua
@@ -16,12 +16,12 @@ function _listen(addr, port, filepath)
local sock = socket.bind(addr, port)
sock:listen(100)
- print("%s: listening %s:%d ..", sock, addr, port)
- while true do
+ print("%s: listening %s:%d ..", sock, addr, port)
+ while true do
local sock_client = sock:accept()
if sock_client then
- print("%s: accepted", sock_client)
- scheduler.co_start(_session, sock_client, filepath)
+ print("%s: accepted", sock_client)
+ scheduler.co_start(_session, sock_client, filepath)
end
end
sock:close()
diff --git a/tests/modules/socket/sched_udp/echo_server.lua b/tests/modules/socket/sched_udp/echo_server.lua
index 21f8c887d..129aab7e5 100644
--- a/tests/modules/socket/sched_udp/echo_server.lua
+++ b/tests/modules/socket/sched_udp/echo_server.lua
@@ -4,7 +4,7 @@ import("core.base.scheduler")
function _listen(addr, port)
local sock = socket.udp()
sock:bind(addr, port)
- while true do
+ while true do
print("%s: recv in %s:%d ..", sock, addr, port)
local recv, data, peer_addr, peer_port = sock:recvfrom(8192, {block = true})
print("%s: recv %d bytes from: %s:%d", sock, recv, peer_addr, peer_port)
diff --git a/tests/modules/socket/tcp/echo_server.lua b/tests/modules/socket/tcp/echo_server.lua
index 9ff19dbed..fb70bd424 100644
--- a/tests/modules/socket/tcp/echo_server.lua
+++ b/tests/modules/socket/tcp/echo_server.lua
@@ -6,11 +6,11 @@ function main()
local port = 9001
local sock = socket.bind(addr, port)
sock:listen(20)
- print("%s: listening %s:%d ..", sock, addr, port)
- while true do
+ print("%s: listening %s:%d ..", sock, addr, port)
+ while true do
local sock_client = sock:accept()
if sock_client then
- print("%s: accepted", sock_client)
+ print("%s: accepted", sock_client)
local count = 0
local result = nil
while true do
diff --git a/tests/modules/socket/tcp/file_server.lua b/tests/modules/socket/tcp/file_server.lua
index d619a496f..1cbf40339 100644
--- a/tests/modules/socket/tcp/file_server.lua
+++ b/tests/modules/socket/tcp/file_server.lua
@@ -6,11 +6,11 @@ function main(filepath)
local port = 9090
local sock = socket.bind(addr, port)
sock:listen(20)
- print("%s: listening %s:%d ..", sock, addr, port)
- while true do
+ print("%s: listening %s:%d ..", sock, addr, port)
+ while true do
local sock_client = sock:accept()
if sock_client then
- print("%s: accepted", sock_client)
+ print("%s: accepted", sock_client)
local file = io.open(filepath, 'rb')
if file then
local send = sock_client:sendfile(file, {block = true})
diff --git a/tests/modules/socket/udp/echo_server.lua b/tests/modules/socket/udp/echo_server.lua
index 84f55eae4..9dad7daee 100644
--- a/tests/modules/socket/udp/echo_server.lua
+++ b/tests/modules/socket/udp/echo_server.lua
@@ -5,7 +5,7 @@ function main()
local port = 9001
local sock = socket.udp()
sock:bind(addr, port)
- while true do
+ while true do
print("%s: recv in %s:%d ..", sock, addr, port)
local recv, data, peer_addr, peer_port = sock:recvfrom(8192, {block = true})
print("%s: recv %d bytes from: %s:%d", sock, recv, peer_addr, peer_port)
diff --git a/tests/modules/socket/unix_tcp/echo_server.lua b/tests/modules/socket/unix_tcp/echo_server.lua
index 8b69d495f..8a1ea6c7d 100644
--- a/tests/modules/socket/unix_tcp/echo_server.lua
+++ b/tests/modules/socket/unix_tcp/echo_server.lua
@@ -6,11 +6,11 @@ function main(addr)
os.tryrm(addr)
local sock = socket.bind_unix(addr)
sock:listen(20)
- print("%s: listening %s ..", sock, addr)
- while true do
+ print("%s: listening %s ..", sock, addr)
+ while true do
local sock_client = sock:accept()
if sock_client then
- print("%s: accepted", sock_client)
+ print("%s: accepted", sock_client)
local count = 0
local result = nil
while true do
diff --git a/tests/modules/socket/unix_tcp/file_server.lua b/tests/modules/socket/unix_tcp/file_server.lua
index b17d71104..96560ff67 100644
--- a/tests/modules/socket/unix_tcp/file_server.lua
+++ b/tests/modules/socket/unix_tcp/file_server.lua
@@ -4,11 +4,11 @@ function main(filepath, addr)
addr = addr or path.join(os.tmpdir(), "file.socket")
local sock = socket.bind_unix(addr)
sock:listen(20)
- print("%s: listening %s ..", sock, addr)
- while true do
+ print("%s: listening %s ..", sock, addr)
+ while true do
local sock_client = sock:accept()
if sock_client then
- print("%s: accepted", sock_client)
+ print("%s: accepted", sock_client)
local file = io.open(filepath, 'rb')
if file then
local send = sock_client:sendfile(file, {block = true})