aboutsummaryrefslogtreecommitdiff
path: root/tests/lanes_as_upvalue.lua
blob: 1c316e42f2549d986dc7f83458976930bdfceb65 (plain)
1
2
3
4
5
6
7
8
9
10
11
local lanes = require "lanes".configure{ with_timers = true, verbose_errors = true} -- with timers enabled

local function foo()
	local lanes = lanes -- lanes as upvalue
end

local g = lanes.gen( "*", { name = 'auto', error_trace_level = "extended"}, foo)

-- this should raise an error as lanes.timer_lane is a Lane (a non-deep full userdata)
local res, err = pcall( g)
assert(res == false and type(err) == "string", "got " .. tostring(res) .. " " .. tostring(err))