diff options
Diffstat (limited to 'tests/modules/scheduler/test.lua')
| -rw-r--r-- | tests/modules/scheduler/test.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/modules/scheduler/test.lua b/tests/modules/scheduler/test.lua index f794c8a3e..d7f09bd96 100644 --- a/tests/modules/scheduler/test.lua +++ b/tests/modules/scheduler/test.lua @@ -30,3 +30,16 @@ function test_sleep(t) scheduler.runloop() end +function test_yield(t) + + local count = 0 + local task = function (a) + scheduler.co_yield() + count = count + 1 + end + for i = 1, 10 do + scheduler.co_start(task) + end + scheduler.runloop() + t:are_equal(count, 10) +end |
