diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/modules/scheduler/test.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/modules/scheduler/test.lua b/tests/modules/scheduler/test.lua index 364b87d2d..3e5cb83b1 100644 --- a/tests/modules/scheduler/test.lua +++ b/tests/modules/scheduler/test.lua @@ -15,16 +15,20 @@ end function test_sleep(t) - --[[ + local count = 0 local task = function (a) local dt = os.mclock() scheduler.sleep(500) dt = os.mclock() - dt t:require(dt > 100 and dt < 1000) + count = count + 1 + if count == 3 then + scheduler.stop() + end end for i = 1, 3 do scheduler.co_start(task) end - scheduler.runloop()]] + scheduler.runloop() end |
