Details in tests

- Added a test for calling 'debug.traceback' after yields inside
hooks. (Lua 5.3 seems to have a bug there.)

- Removed test "repeat test with '__open' metamethod instead of a
function", as the previous test already uses the '__open' metamethod.
(It changed when functions were removed as possible to-be-closed
variables).
This commit is contained in:
Roberto Ierusalimschy
2019-06-21 10:21:07 -03:00
parent e4b02ca8e4
commit 6b9490bd72
2 changed files with 10 additions and 18 deletions

View File

@@ -426,6 +426,10 @@ else
while A==0 or B==0 do -- A ~= 0 when 'x' finishes (similar for 'B','y')
if A==0 then turn = "A"; assert(T.resume(x)) end
if B==0 then turn = "B"; assert(T.resume(y)) end
-- check that traceback works correctly after yields inside hooks
debug.traceback(x)
debug.traceback(y)
end
assert(B // A == 7) -- fact(7) // fact(6)