aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cancel.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/cancel.lua b/tests/cancel.lua
index b75d085..92ab439 100644
--- a/tests/cancel.lua
+++ b/tests/cancel.lua
@@ -10,8 +10,15 @@ end
10local lanes = require "lanes" .configure{ with_timers = false} 10local lanes = require "lanes" .configure{ with_timers = false}
11 11
12local SLEEP = function(...) 12local SLEEP = function(...)
13 local k, v = lanes.sleep(...) 13 -- just for fun: start a lane that will do the sleeping for us
14 assert(k == nil and v == "timeout") 14 local sleeperBody = function(...)
15 local lanes = require "lanes"
16 local k, v = lanes.sleep(...)
17 assert(k == nil and v == "timeout")
18 end
19 local sleeper = lanes.gen("*", sleeperBody)(...)
20 -- then wait for the lane to terminate
21 sleeper:join()
15end 22end
16 23
17local linda = lanes.linda() 24local linda = lanes.linda()