aboutsummaryrefslogtreecommitdiff
path: root/tests/errhangtest.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errhangtest.lua')
-rw-r--r--tests/errhangtest.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/errhangtest.lua b/tests/errhangtest.lua
new file mode 100644
index 0000000..ddc1bfb
--- /dev/null
+++ b/tests/errhangtest.lua
@@ -0,0 +1,13 @@
1lanes = require('lanes')
2
3local linda = lanes.linda()
4
5local coro = coroutine.create(function() end)
6
7-- we are not allowed to send coroutines through a lanes
8-- however, this should raise an error, not hang the program...
9print( pcall(linda.send,linda, 'test', "oh boy"))
10print( pcall(linda.send,linda, 'test', coro))
11res = linda:receive('test')
12print( res)
13-- linda:send( 'test', coro)