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

@@ -209,6 +209,10 @@ if #msgs > 0 then
warn("#tests not performed:\n ", m, "\n")
end
warn("@off")
warn("******** THIS WARNING SHOULD NOT APPEAR **********")
warn("******** THIS WARNING ALSO SHOULD NOT APPEAR **********")
warn("@on")
print("(there should be two warnings now)")
warn("#This is ", "an expected", " warning")
warn("#This is", " another one")