diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-15 13:44:36 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-15 13:44:36 -0300 |
commit | a1d8eb27431c02c4529be1efd92143ad65434f3a (patch) | |
tree | 58db9340ba2b8ea1cb91004b96f15a955f167c58 /testes/api.lua | |
parent | f64a1b175a5fa65434a073e6d071b32bb7b0ab69 (diff) | |
download | lua-a1d8eb27431c02c4529be1efd92143ad65434f3a.tar.gz lua-a1d8eb27431c02c4529be1efd92143ad65434f3a.tar.bz2 lua-a1d8eb27431c02c4529be1efd92143ad65434f3a.zip |
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.
Diffstat (limited to 'testes/api.lua')
-rw-r--r-- | testes/api.lua | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/testes/api.lua b/testes/api.lua index f6915c3e..4f9d6717 100644 --- a/testes/api.lua +++ b/testes/api.lua | |||
@@ -977,6 +977,7 @@ assert(t[7] == nil) | |||
977 | 977 | ||
978 | ------------------------------------------------------------------------- | 978 | ------------------------------------------------------------------------- |
979 | do -- testing errors during GC | 979 | do -- testing errors during GC |
980 | warn("@off") | ||
980 | collectgarbage("stop") | 981 | collectgarbage("stop") |
981 | local a = {} | 982 | local a = {} |
982 | for i=1,20 do | 983 | for i=1,20 do |
@@ -994,6 +995,7 @@ do -- testing errors during GC | |||
994 | collectgarbage() | 995 | collectgarbage() |
995 | assert(A == 10) -- number of normal collections | 996 | assert(A == 10) -- number of normal collections |
996 | collectgarbage("restart") | 997 | collectgarbage("restart") |
998 | warn("@on") | ||
997 | end | 999 | end |
998 | ------------------------------------------------------------------------- | 1000 | ------------------------------------------------------------------------- |
999 | -- test for userdata vals | 1001 | -- test for userdata vals |