diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-12-28 15:42:34 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-12-28 15:42:34 -0200 |
commit | 437a5b07d415e1a74160ddfd804017171d6cc5cb (patch) | |
tree | 861f9a56ae175eaed91c163409c33ab85bee7ff9 /testes/api.lua | |
parent | ba7da13ec5938f978c37d63aa40a3e340b301f79 (diff) | |
download | lua-437a5b07d415e1a74160ddfd804017171d6cc5cb.tar.gz lua-437a5b07d415e1a74160ddfd804017171d6cc5cb.tar.bz2 lua-437a5b07d415e1a74160ddfd804017171d6cc5cb.zip |
Added a warning system to Lua
The warning system is just a way for Lua to emit warnings, messages
to the programmer that do not interfere with the running program.
Diffstat (limited to 'testes/api.lua')
-rw-r--r-- | testes/api.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testes/api.lua b/testes/api.lua index 6f35e132..b4d63866 100644 --- a/testes/api.lua +++ b/testes/api.lua | |||
@@ -111,6 +111,20 @@ do -- testing 'rotate' | |||
111 | tcheck(t, {10, 20, 30, 40}) | 111 | tcheck(t, {10, 20, 30, 40}) |
112 | end | 112 | end |
113 | 113 | ||
114 | |||
115 | -- testing warnings | ||
116 | T.testC([[ | ||
117 | warning "*This " | ||
118 | warning "warning " | ||
119 | warning "should be in a" | ||
120 | warning " single line | ||
121 | " | ||
122 | warning "*This should be " | ||
123 | warning "another warning | ||
124 | " | ||
125 | ]]) | ||
126 | |||
127 | |||
114 | -- testing message handlers | 128 | -- testing message handlers |
115 | do | 129 | do |
116 | local f = T.makeCfunc[[ | 130 | local f = T.makeCfunc[[ |