diff options
Diffstat (limited to 'tests/errhangtest.lua')
-rw-r--r-- | tests/errhangtest.lua | 9 |
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 @@ | |||
1 | local lanes = require "lanes".configure{with_timers=false} | 1 | local lanes = require "lanes".configure{with_timers=false,strip_functions=false} |
2 | |||
3 | local require_assert_result_1, require_assert_result_2 = require "assert" -- assert.fails() | ||
4 | print("require_assert_result:", require_assert_result_1, require_assert_result_2) | ||
5 | |||
2 | local linda = lanes.linda() | 6 | local 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 |
23 | if true then | 27 | if 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 |