From c3e9e26d5eb455f95e62fa8801cca9d4e7792acc Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Fri, 24 May 2024 08:59:08 +0200 Subject: Process upvalues equal to _G in Lua51 as in other flavors --- tests/basic.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/basic.lua b/tests/basic.lua index 5a905e7..cfe6fd5 100644 --- a/tests/basic.lua +++ b/tests/basic.lua @@ -142,7 +142,8 @@ if st=="done" then end assert(st=="running") -lane9:cancel("count", 100) -- 0 timeout, 100 instructions count hook +-- when running under luajit, the function is JIT-ed, and the instruction count isn't hit, so we need a different hook +lane9:cancel(jit and "line" or "count", 100) -- 0 timeout, hook triggers cancelslation when reaching the specified count local t0= os.time() while os.time()-t0 < 5 do @@ -151,7 +152,7 @@ while os.time()-t0 < 5 do if st~="running" then break end end PRINT(" "..st) -assert(st == "cancelled") +assert(st == "cancelled", "st is '" .. st .. "' instead of 'cancelled'") -- cancellation of lanes waiting on a linda local limited = lanes.linda("limited") -- cgit v1.2.3-55-g6feb