mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
No more LUA_ERRGCMM errors
Errors in finalizers (__gc metamethods) are never propagated. Instead, they generate a warning.
This commit is contained in:
parent
437a5b07d4
commit
c6f7181e91
10 changed files with 143 additions and 109 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue