commit 5bc47fe83087e0686f4639d031801837846e4c65
parent 9405472565cb4b0cb0c339d65babdef4d4cb7abd
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Mon, 19 Aug 2019 14:41:21 -0300
Detail (extra test for warnings when closing state)
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/testes/main.lua b/testes/main.lua
@@ -243,6 +243,17 @@ Lua warning: @on
Lua warning: ZZZ
]]
+prepfile[[
+warn("@allow")
+-- create two objects to be finalized when closing state
+-- the errors in the finalizers must generate warnings
+u1 = setmetatable({}, {__gc = function () error("XYZ") end})
+u2 = setmetatable({}, {__gc = function () error("ZYX") end})
+]]
+RUN('lua %s 2> %s', prog, out)
+checkprogout("ZYX)\nXYZ)\n")
+
+
-- test many arguments
prepfile[[print(({...})[30])]]
RUN('lua %s %s > %s', prog, string.rep(" a", 30), out)