aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2024-05-24 08:59:08 +0200
committerBenoit Germain <benoit.germain@ubisoft.com>2024-05-24 09:09:56 +0200
commitc3e9e26d5eb455f95e62fa8801cca9d4e7792acc (patch)
tree5b8645817abe4eb1123647a4e9c5204d0e35d9b1 /tests
parent3be94c4282bbe77895e952afb12a81e55c2a4391 (diff)
downloadlanes-c3e9e26d5eb455f95e62fa8801cca9d4e7792acc.tar.gz
lanes-c3e9e26d5eb455f95e62fa8801cca9d4e7792acc.tar.bz2
lanes-c3e9e26d5eb455f95e62fa8801cca9d4e7792acc.zip
Process upvalues equal to _G in Lua51 as in other flavors
Diffstat (limited to 'tests')
-rw-r--r--tests/basic.lua5
1 files changed, 3 insertions, 2 deletions
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
142end 142end
143assert(st=="running") 143assert(st=="running")
144 144
145lane9:cancel("count", 100) -- 0 timeout, 100 instructions count hook 145-- when running under luajit, the function is JIT-ed, and the instruction count isn't hit, so we need a different hook
146lane9:cancel(jit and "line" or "count", 100) -- 0 timeout, hook triggers cancelslation when reaching the specified count
146 147
147local t0= os.time() 148local t0= os.time()
148while os.time()-t0 < 5 do 149while os.time()-t0 < 5 do
@@ -151,7 +152,7 @@ while os.time()-t0 < 5 do
151 if st~="running" then break end 152 if st~="running" then break end
152end 153end
153PRINT(" "..st) 154PRINT(" "..st)
154assert(st == "cancelled") 155assert(st == "cancelled", "st is '" .. st .. "' instead of 'cancelled'")
155 156
156-- cancellation of lanes waiting on a linda 157-- cancellation of lanes waiting on a linda
157local limited = lanes.linda("limited") 158local limited = lanes.linda("limited")