diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-20 13:42:26 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-20 13:42:26 -0300 |
commit | be78aeae4c429d7d68af3a3e1b0cf8e52fcff160 (patch) | |
tree | e81d25014e238f589997f109ba10a875c3a875dc /testes/main.lua | |
parent | 5bc47fe83087e0686f4639d031801837846e4c65 (diff) | |
download | lua-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.lua | 11 |
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'")) | |||
221 | RUN('echo "io.stderr:write(1000)\ncont" | lua -e "require\'debug\'.debug()" 2> %s', out) | 221 | RUN('echo "io.stderr:write(1000)\ncont" | lua -e "require\'debug\'.debug()" 2> %s', out) |
222 | checkout("lua_debug> 1000lua_debug> ") | 222 | checkout("lua_debug> 1000lua_debug> ") |
223 | 223 | ||
224 | -- test warnings | 224 | |
225 | RUN('echo "io.stderr:write(1); warn[[XXX]]" | lua -q 2> %s', out) | 225 | print("testing warnings") |
226 | |||
227 | -- no warnings by default | ||
228 | RUN('echo "io.stderr:write(1); warn[[XXX]]" | lua 2> %s', out) | ||
226 | checkout("1") | 229 | checkout("1") |
227 | 230 | ||
228 | prepfile[[ | 231 | prepfile[[ |
@@ -236,7 +239,7 @@ warn("", "@on") -- again, no control, real warning | |||
236 | warn("@on") -- keep it "started" | 239 | warn("@on") -- keep it "started" |
237 | warn("Z", "Z", "Z") -- common warning | 240 | warn("Z", "Z", "Z") -- common warning |
238 | ]] | 241 | ]] |
239 | RUN('lua %s 2> %s', prog, out) | 242 | RUN('lua -W %s 2> %s', prog, out) |
240 | checkout[[ | 243 | checkout[[ |
241 | Lua warning: @offXXX@off | 244 | Lua warning: @offXXX@off |
242 | Lua warning: @on | 245 | Lua warning: @on |
@@ -250,7 +253,7 @@ warn("@allow") | |||
250 | u1 = setmetatable({}, {__gc = function () error("XYZ") end}) | 253 | u1 = setmetatable({}, {__gc = function () error("XYZ") end}) |
251 | u2 = setmetatable({}, {__gc = function () error("ZYX") end}) | 254 | u2 = setmetatable({}, {__gc = function () error("ZYX") end}) |
252 | ]] | 255 | ]] |
253 | RUN('lua %s 2> %s', prog, out) | 256 | RUN('lua -W %s 2> %s', prog, out) |
254 | checkprogout("ZYX)\nXYZ)\n") | 257 | checkprogout("ZYX)\nXYZ)\n") |
255 | 258 | ||
256 | 259 | ||