diff options
| author | ruki <[email protected]> | 2025-08-28 23:16:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-08-28 23:16:25 +0800 |
| commit | 3a1890f777eec156fd4e85616e9487a4fdc92abc (patch) | |
| tree | b5f3ec0b1ad5bb156e3787a641726669074e42c3 /tests/modules | |
| parent | 62a17c8f3052a0dc16f4e035d2115e88dde6a7ac (diff) | |
improve tests
Diffstat (limited to 'tests/modules')
| -rw-r--r-- | tests/modules/thread/queue.lua | 14 |
1 files changed, 6 insertions, 8 deletions
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 |
