Added control messages to warnings

Added the concept of control messages to the warning system, plus the
implementation of the controls "@on"/"@off" to turn warnings on/off.
Moreover, the warning system in the test library adds some other
controls to ease the test of warnings.
This commit is contained in:
Roberto Ierusalimschy
2019-08-15 13:44:36 -03:00
parent f64a1b175a
commit a1d8eb2743
9 changed files with 160 additions and 48 deletions

View File

@@ -977,6 +977,7 @@ assert(t[7] == nil)
-------------------------------------------------------------------------
do -- testing errors during GC
warn("@off")
collectgarbage("stop")
local a = {}
for i=1,20 do
@@ -994,6 +995,7 @@ do -- testing errors during GC
collectgarbage()
assert(A == 10) -- number of normal collections
collectgarbage("restart")
warn("@on")
end
-------------------------------------------------------------------------
-- test for userdata vals