aboutsummaryrefslogtreecommitdiff
path: root/tests/errhangtest.lua
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-05-31 17:04:17 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-05-31 17:04:17 +0200
commitf7a38b5681ebf7429828fca9a9f7c109df853d54 (patch)
tree9c4e702071a6915719ca639790936b35ed1ed828 /tests/errhangtest.lua
parent95e5bf6461be6e227466911d5e3a683d149df725 (diff)
downloadlanes-f7a38b5681ebf7429828fca9a9f7c109df853d54.tar.gz
lanes-f7a38b5681ebf7429828fca9a9f7c109df853d54.tar.bz2
lanes-f7a38b5681ebf7429828fca9a9f7c109df853d54.zip
Some API changes
* lanes.timers() can return nil, cancel_error if interrupted * linda:receive() always return a k,v, where k is nil when v is "timeout" or cancel_error * lanes.sleep returns nil, "timeout" during normal operations
Diffstat (limited to 'tests/errhangtest.lua')
-rw-r--r--tests/errhangtest.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/errhangtest.lua b/tests/errhangtest.lua
index 84de8c6..99f44b2 100644
--- a/tests/errhangtest.lua
+++ b/tests/errhangtest.lua
@@ -24,8 +24,10 @@ if true then
24 print "\n#### set 3 -> receive batched" 24 print "\n#### set 3 -> receive batched"
25 local fun = function() print "function test ok" end 25 local fun = function() print "function test ok" end
26 print(pcall(linda.set, linda, 'test', true, nil, fun)) 26 print(pcall(linda.set, linda, 'test', true, nil, fun))
27 local k,b,n,f = linda:receive(linda.batched, 'test', 3) -- read back the contents 27 -- read back the contents
28 local k,b,n,f = linda:receive(linda.batched, 'test', 3)
28 assert(linda:get("test") == nil) 29 assert(linda:get("test") == nil)
30 -- check they are ok
29 print(k, b, n) 31 print(k, b, n)
30 f() 32 f()
31 print "OK" 33 print "OK"