aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cancel.lua19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/cancel.lua b/tests/cancel.lua
index 0aab341..a5f1dab 100644
--- a/tests/cancel.lua
+++ b/tests/cancel.lua
@@ -83,11 +83,26 @@ h = lanes.gen("*", laneBody)()
83print "wait 3s" 83print "wait 3s"
84linda:receive( 3, "yeah") 84linda:receive( 3, "yeah")
85 85
86-- hard cancel and wait 10s: the lane will be interrupted from inside its current linda:receive() and won't return from it 86-- hard cancel: the lane will be interrupted from inside its current linda:receive() and won't return from it
87print "hard cancel (always awakens)" 87print "hard cancel (always awakens)"
88h:cancel() 88h:cancel()
89 89
90print "wait 5s" 90print "wait 5s"
91linda:receive( 5, "yeah") 91linda:receive( 5, "yeah")
92 92
93print "\ndone" \ No newline at end of file 93--####################################################################
94print "\n\n####################################################################\nbegin linda cancel test\n"
95h = lanes.gen("*", laneBody)()
96
97-- wait 3s before cancelling the lane
98print "wait 3s"
99linda:receive( 3, "yeah")
100
101-- linda cancel: the lane will be interrupted from inside its current linda:receive() and won't return from it
102print "linda cancel (always awakens the lane)"
103linda:cancel( "both")
104
105print "wait 5s"
106linda:receive( 5, "yeah")
107
108print "\ndone"