aboutsummaryrefslogtreecommitdiff
path: root/unit_tests/scripts/coro
diff options
context:
space:
mode:
authorBenoit Germain <benoit.germain@ubisoft.com>2025-03-10 14:34:16 +0100
committerBenoit Germain <benoit.germain@ubisoft.com>2025-03-10 14:34:16 +0100
commitd290acf78ad4291099ebccdf94d81aa60ce866bb (patch)
treea26ce9141df136862c862c6f30524652b8eb7ab0 /unit_tests/scripts/coro
parentb35f8f264d806b0a614588e75f9b7c2712c860a4 (diff)
downloadlanes-d290acf78ad4291099ebccdf94d81aa60ce866bb.tar.gz
lanes-d290acf78ad4291099ebccdf94d81aa60ce866bb.tar.bz2
lanes-d290acf78ad4291099ebccdf94d81aa60ce866bb.zip
Fix/disable some unit tests against LuaJIT until the failure reason is discovered
* cancel.lua fails when using lanes.coro * coro/basics.lua fails because an error message is different * coro/error_handling fails for an unknown reason * a lanes.finally test crashes inside lua_close
Diffstat (limited to 'unit_tests/scripts/coro')
-rw-r--r--unit_tests/scripts/coro/basics.lua7
-rw-r--r--unit_tests/scripts/coro/error_handling.lua2
2 files changed, 6 insertions, 3 deletions
diff --git a/unit_tests/scripts/coro/basics.lua b/unit_tests/scripts/coro/basics.lua
index 4444e87..dc74b7c 100644
--- a/unit_tests/scripts/coro/basics.lua
+++ b/unit_tests/scripts/coro/basics.lua
@@ -47,14 +47,17 @@ if true then
47 local err, status, stack = h:join() 47 local err, status, stack = h:join()
48 PRINT(err, status, stack) 48 PRINT(err, status, stack)
49 -- the actual error message is not the same for Lua 5.1 49 -- the actual error message is not the same for Lua 5.1
50 -- of course, it also has to be different for LuaJIT as well
51 -- also, LuaJIT prepends a file:line to the actual error message, which Lua5.1 does not.
50 local msgs = { 52 local msgs = {
51 ["Lua 5.1"] = "attempt to yield across metamethod/C-call boundary", 53 ["Lua 5.1"] = jit and "attempt to yield across C-call boundary" or "attempt to yield across metamethod/C-call boundary",
52 ["Lua 5.2"] = "attempt to yield from outside a coroutine", 54 ["Lua 5.2"] = "attempt to yield from outside a coroutine",
53 ["Lua 5.3"] = "attempt to yield from outside a coroutine", 55 ["Lua 5.3"] = "attempt to yield from outside a coroutine",
54 ["Lua 5.4"] = "attempt to yield from outside a coroutine" 56 ["Lua 5.4"] = "attempt to yield from outside a coroutine"
55 } 57 }
56 local expected_msg = msgs[_VERSION] 58 local expected_msg = msgs[_VERSION]
57 assert(err == nil and status == expected_msg and stack == nil, "status = " .. status) 59 PRINT("expected_msg = " .. expected_msg)
60 assert(err == nil and string.find(status, expected_msg, 1, true) and stack == nil, "status = " .. status)
58end 61end
59 62
60-- the generator 63-- the generator
diff --git a/unit_tests/scripts/coro/error_handling.lua b/unit_tests/scripts/coro/error_handling.lua
index 3b50c7f..ba6cff6 100644
--- a/unit_tests/scripts/coro/error_handling.lua
+++ b/unit_tests/scripts/coro/error_handling.lua
@@ -60,5 +60,5 @@ if true then
60 local a, b, c = h:join() 60 local a, b, c = h:join()
61 -- we get the expected error back 61 -- we get the expected error back
62 PRINT("non_string_thrower:", a, b, c) 62 PRINT("non_string_thrower:", a, b, c)
63 assert(a == nil and type(b) == "table" and b[1] == "string in table" and c == nil) 63 assert(a == nil and type(b) == "table" and b[1] == "string in table" and c == nil, "a=" .. tostring(a) .. " b=" .. tostring(b))
64end 64end