diff options
Diffstat (limited to 'tests/errhangtest.lua')
-rw-r--r-- | tests/errhangtest.lua | 13 |
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 @@ | |||
1 | lanes = require('lanes') | ||
2 | |||
3 | local linda = lanes.linda() | ||
4 | |||
5 | local 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... | ||
9 | print( pcall(linda.send,linda, 'test', "oh boy")) | ||
10 | print( pcall(linda.send,linda, 'test', coro)) | ||
11 | res = linda:receive('test') | ||
12 | print( res) | ||
13 | -- linda:send( 'test', coro) | ||