From d290acf78ad4291099ebccdf94d81aa60ce866bb Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Mon, 10 Mar 2025 14:34:16 +0100 Subject: 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 --- unit_tests/scripts/coro/basics.lua | 7 +++++-- unit_tests/scripts/coro/error_handling.lua | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'unit_tests/scripts') 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 local err, status, stack = h:join() PRINT(err, status, stack) -- the actual error message is not the same for Lua 5.1 + -- of course, it also has to be different for LuaJIT as well + -- also, LuaJIT prepends a file:line to the actual error message, which Lua5.1 does not. local msgs = { - ["Lua 5.1"] = "attempt to yield across metamethod/C-call boundary", + ["Lua 5.1"] = jit and "attempt to yield across C-call boundary" or "attempt to yield across metamethod/C-call boundary", ["Lua 5.2"] = "attempt to yield from outside a coroutine", ["Lua 5.3"] = "attempt to yield from outside a coroutine", ["Lua 5.4"] = "attempt to yield from outside a coroutine" } local expected_msg = msgs[_VERSION] - assert(err == nil and status == expected_msg and stack == nil, "status = " .. status) + PRINT("expected_msg = " .. expected_msg) + assert(err == nil and string.find(status, expected_msg, 1, true) and stack == nil, "status = " .. status) end -- 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 local a, b, c = h:join() -- we get the expected error back PRINT("non_string_thrower:", a, b, c) - assert(a == nil and type(b) == "table" and b[1] == "string in table" and c == nil) + assert(a == nil and type(b) == "table" and b[1] == "string in table" and c == nil, "a=" .. tostring(a) .. " b=" .. tostring(b)) end -- cgit v1.2.3-55-g6feb