diff options
Diffstat (limited to 'unit_tests/scripts/coro/basics.lua')
-rw-r--r-- | unit_tests/scripts/coro/basics.lua | 7 |
1 files changed, 5 insertions, 2 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) | ||
58 | end | 61 | end |
59 | 62 | ||
60 | -- the generator | 63 | -- the generator |