summaryrefslogtreecommitdiff
path: root/tests/errhangtest.lua
blob: ddc1bfb2412c5b3c0d151704a7de024ea4270cb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
lanes = require('lanes')

local linda = lanes.linda()

local coro = coroutine.create(function() end)

-- we are not allowed to send coroutines through a lanes
-- however, this should raise an error, not hang the program...
print( pcall(linda.send,linda, 'test', "oh boy"))
print( pcall(linda.send,linda, 'test', coro))
res = linda:receive('test')
print( res)
-- linda:send( 'test', coro)