aboutsummaryrefslogtreecommitdiff
path: root/testes/main.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-20 13:42:26 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-20 13:42:26 -0300
commitbe78aeae4c429d7d68af3a3e1b0cf8e52fcff160 (patch)
treee81d25014e238f589997f109ba10a875c3a875dc /testes/main.lua
parent5bc47fe83087e0686f4639d031801837846e4c65 (diff)
downloadlua-be78aeae4c429d7d68af3a3e1b0cf8e52fcff160.tar.gz
lua-be78aeae4c429d7d68af3a3e1b0cf8e52fcff160.tar.bz2
lua-be78aeae4c429d7d68af3a3e1b0cf8e52fcff160.zip
Default for warnings changed to "off"
Warnings are mostly a tool to help developers (e.g., by showing hidden error messages); regular users usually don't need to see them.
Diffstat (limited to 'testes/main.lua')
-rw-r--r--testes/main.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/testes/main.lua b/testes/main.lua
index 5d2652cb..de14a088 100644
--- a/testes/main.lua
+++ b/testes/main.lua
@@ -221,8 +221,11 @@ assert(string.find(getoutput(), "error calling 'print'"))
221RUN('echo "io.stderr:write(1000)\ncont" | lua -e "require\'debug\'.debug()" 2> %s', out) 221RUN('echo "io.stderr:write(1000)\ncont" | lua -e "require\'debug\'.debug()" 2> %s', out)
222checkout("lua_debug> 1000lua_debug> ") 222checkout("lua_debug> 1000lua_debug> ")
223 223
224-- test warnings 224
225RUN('echo "io.stderr:write(1); warn[[XXX]]" | lua -q 2> %s', out) 225print("testing warnings")
226
227-- no warnings by default
228RUN('echo "io.stderr:write(1); warn[[XXX]]" | lua 2> %s', out)
226checkout("1") 229checkout("1")
227 230
228prepfile[[ 231prepfile[[
@@ -236,7 +239,7 @@ warn("", "@on") -- again, no control, real warning
236warn("@on") -- keep it "started" 239warn("@on") -- keep it "started"
237warn("Z", "Z", "Z") -- common warning 240warn("Z", "Z", "Z") -- common warning
238]] 241]]
239RUN('lua %s 2> %s', prog, out) 242RUN('lua -W %s 2> %s', prog, out)
240checkout[[ 243checkout[[
241Lua warning: @offXXX@off 244Lua warning: @offXXX@off
242Lua warning: @on 245Lua warning: @on
@@ -250,7 +253,7 @@ warn("@allow")
250u1 = setmetatable({}, {__gc = function () error("XYZ") end}) 253u1 = setmetatable({}, {__gc = function () error("XYZ") end})
251u2 = setmetatable({}, {__gc = function () error("ZYX") end}) 254u2 = setmetatable({}, {__gc = function () error("ZYX") end})
252]] 255]]
253RUN('lua %s 2> %s', prog, out) 256RUN('lua -W %s 2> %s', prog, out)
254checkprogout("ZYX)\nXYZ)\n") 257checkprogout("ZYX)\nXYZ)\n")
255 258
256 259