diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-19 14:41:48 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-19 14:41:48 -0300 |
commit | 5bc47fe83087e0686f4639d031801837846e4c65 (patch) | |
tree | c431cb5ca8a8ae390f48ab8e8af9b5eed1802642 | |
parent | 9405472565cb4b0cb0c339d65babdef4d4cb7abd (diff) | |
download | lua-5bc47fe83087e0686f4639d031801837846e4c65.tar.gz lua-5bc47fe83087e0686f4639d031801837846e4c65.tar.bz2 lua-5bc47fe83087e0686f4639d031801837846e4c65.zip |
Detail (extra test for warnings when closing state)
-rw-r--r-- | testes/main.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testes/main.lua b/testes/main.lua index 36220362..5d2652cb 100644 --- a/testes/main.lua +++ b/testes/main.lua | |||
@@ -243,6 +243,17 @@ Lua warning: @on | |||
243 | Lua warning: ZZZ | 243 | Lua warning: ZZZ |
244 | ]] | 244 | ]] |
245 | 245 | ||
246 | prepfile[[ | ||
247 | warn("@allow") | ||
248 | -- create two objects to be finalized when closing state | ||
249 | -- the errors in the finalizers must generate warnings | ||
250 | u1 = setmetatable({}, {__gc = function () error("XYZ") end}) | ||
251 | u2 = setmetatable({}, {__gc = function () error("ZYX") end}) | ||
252 | ]] | ||
253 | RUN('lua %s 2> %s', prog, out) | ||
254 | checkprogout("ZYX)\nXYZ)\n") | ||
255 | |||
256 | |||
246 | -- test many arguments | 257 | -- test many arguments |
247 | prepfile[[print(({...})[30])]] | 258 | prepfile[[print(({...})[30])]] |
248 | RUN('lua %s %s > %s', prog, string.rep(" a", 30), out) | 259 | RUN('lua %s %s > %s', prog, string.rep(" a", 30), out) |