No more LUA_ERRGCMM errors

Errors in finalizers (__gc metamethods) are never propagated.
Instead, they generate a warning.
This commit is contained in:
Roberto Ierusalimschy
2019-01-01 12:14:56 -02:00
parent 437a5b07d4
commit c6f7181e91
10 changed files with 143 additions and 109 deletions

View File

@@ -190,12 +190,17 @@ assert(dofile('verybig.lua', true) == 10); collectgarbage()
dofile('files.lua')
if #msgs > 0 then
warn("*tests not performed:\n ")
warn("#tests not performed:\n ")
for i=1,#msgs do
warn(msgs[i]); warn("\n ")
end
warn("\n")
end
print("(there should be two warnings now)")
warn("#This is "); warn("an expected"); warn(" warning\n")
warn("#This is"); warn(" another one\n")
-- no test module should define 'debug'
assert(debug == nil)
@@ -219,10 +224,6 @@ local _G, showmem, print, format, clock, time, difftime, assert, open =
local fname = T and "time-debug.txt" or "time.txt"
local lasttime
warn("*This is "); warn("an expected"); warn(" warning\n")
warn("*This is"); warn(" another one\n")
if not usertests then
-- open file with time of last performed test
local f = io.open(fname)