From 3a1890f777eec156fd4e85616e9487a4fdc92abc Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 28 Aug 2025 23:16:25 +0800 Subject: improve tests --- tests/modules/thread/queue.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'tests/modules/thread/queue.lua') diff --git a/tests/modules/thread/queue.lua b/tests/modules/thread/queue.lua index 36034993f..ebf298ec2 100644 --- a/tests/modules/thread/queue.lua +++ b/tests/modules/thread/queue.lua @@ -1,15 +1,13 @@ import("core.base.thread") function callback(event, queue) - import("core.base.thread") - print("%s: starting ..", thread.running()) + print("starting ..") while true do - print("%s: waiting ..", thread.running()) + print("waiting ..") if event:wait(-1) > 0 then - print("%s: triggered", thread.running()) - end - while not queue:empty() do - print("%s: get %s", thread.running(), queue:pop()) + while not queue:empty() do + print(" -> %s", queue:pop()) + end end end end @@ -17,7 +15,7 @@ end function main() local event = thread.event() local queue = thread.queue() - local t = thread.start_named("keyboard", callback, event, queue) + local t = thread.start_named("", callback, event, queue) while true do local ch = io.read() if ch then -- cgit v1.3.1