diff options
| author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-05-24 08:59:08 +0200 |
|---|---|---|
| committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-05-24 09:09:56 +0200 |
| commit | c3e9e26d5eb455f95e62fa8801cca9d4e7792acc (patch) | |
| tree | 5b8645817abe4eb1123647a4e9c5204d0e35d9b1 /tests | |
| parent | 3be94c4282bbe77895e952afb12a81e55c2a4391 (diff) | |
| download | lanes-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.lua | 5 |
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 | |||
| 142 | end | 142 | end |
| 143 | assert(st=="running") | 143 | assert(st=="running") |
| 144 | 144 | ||
| 145 | lane9: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 |
| 146 | lane9:cancel(jit and "line" or "count", 100) -- 0 timeout, hook triggers cancelslation when reaching the specified count | ||
| 146 | 147 | ||
| 147 | local t0= os.time() | 148 | local t0= os.time() |
| 148 | while os.time()-t0 < 5 do | 149 | while 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 |
| 152 | end | 153 | end |
| 153 | PRINT(" "..st) | 154 | PRINT(" "..st) |
| 154 | assert(st == "cancelled") | 155 | assert(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 |
| 157 | local limited = lanes.linda("limited") | 158 | local limited = lanes.linda("limited") |
