aboutsummaryrefslogtreecommitdiff
path: root/tests/errhangtest.lua
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-06-04 16:19:47 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-06-04 16:19:47 +0200
commitc360af2df3e0904c7338cc1f32fcb270b7e34092 (patch)
tree22b27902eff9148e787c968f5bd60ad44252c3a3 /tests/errhangtest.lua
parent4695cbe96514e6b174fb5050bb2e9a41514091f3 (diff)
downloadlanes-c360af2df3e0904c7338cc1f32fcb270b7e34092.tar.gz
lanes-c360af2df3e0904c7338cc1f32fcb270b7e34092.tar.bz2
lanes-c360af2df3e0904c7338cc1f32fcb270b7e34092.zip
Refactored keeper implementation of linda:receive()
Diffstat (limited to 'tests/errhangtest.lua')
-rw-r--r--tests/errhangtest.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/errhangtest.lua b/tests/errhangtest.lua
index 99f44b2..d0ffcc4 100644
--- a/tests/errhangtest.lua
+++ b/tests/errhangtest.lua
@@ -1,4 +1,8 @@
1local lanes = require "lanes".configure{with_timers=false} 1local lanes = require "lanes".configure{with_timers=false,strip_functions=false}
2
3local require_assert_result_1, require_assert_result_2 = require "assert" -- assert.fails()
4print("require_assert_result:", require_assert_result_1, require_assert_result_2)
5
2local linda = lanes.linda() 6local linda = lanes.linda()
3 7
4-- we are not allowed to send coroutines through a lane 8-- we are not allowed to send coroutines through a lane
@@ -22,6 +26,9 @@ end
22-- get/set a few values 26-- get/set a few values
23if true then 27if true then
24 print "\n#### set 3 -> receive batched" 28 print "\n#### set 3 -> receive batched"
29 assert.fails(function() linda:receive(linda.batched, "some key", -1, 1) end)
30 assert.fails(function() linda:receive(linda.batched, "some key", 2, 1) end)
31 assert.failsnot(function() linda:receive(0, linda.batched, "some key", 1, 3) end)
25 local fun = function() print "function test ok" end 32 local fun = function() print "function test ok" end
26 print(pcall(linda.set, linda, 'test', true, nil, fun)) 33 print(pcall(linda.set, linda, 'test', true, nil, fun))
27 -- read back the contents 34 -- read back the contents