diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-16 09:51:54 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-16 09:51:54 -0300 |
| commit | ca13be9af784b7288d3a07d9b5bccb329086e885 (patch) | |
| tree | c027419f98064d681518a4130439920a13a11b06 /testes/coroutine.lua | |
| parent | a1d8eb27431c02c4529be1efd92143ad65434f3a (diff) | |
| download | lua-ca13be9af784b7288d3a07d9b5bccb329086e885.tar.gz lua-ca13be9af784b7288d3a07d9b5bccb329086e885.tar.bz2 lua-ca13be9af784b7288d3a07d9b5bccb329086e885.zip | |
Supressed errors in '__close' generate warnings
Diffstat (limited to 'testes/coroutine.lua')
| -rw-r--r-- | testes/coroutine.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/testes/coroutine.lua b/testes/coroutine.lua index 457374ca..79c72a9d 100644 --- a/testes/coroutine.lua +++ b/testes/coroutine.lua | |||
| @@ -168,7 +168,7 @@ do | |||
| 168 | local y <close> = func2close(function (self,err) | 168 | local y <close> = func2close(function (self,err) |
| 169 | if (err ~= 111) then os.exit(false) end -- should not happen | 169 | if (err ~= 111) then os.exit(false) end -- should not happen |
| 170 | x = 200 | 170 | x = 200 |
| 171 | error(200) | 171 | error("200") |
| 172 | end) | 172 | end) |
| 173 | local x <close> = func2close(function (self, err) | 173 | local x <close> = func2close(function (self, err) |
| 174 | assert(err == nil); error(111) | 174 | assert(err == nil); error(111) |
| @@ -177,7 +177,10 @@ do | |||
| 177 | end) | 177 | end) |
| 178 | coroutine.resume(co) | 178 | coroutine.resume(co) |
| 179 | assert(x == 0) | 179 | assert(x == 0) |
| 180 | _WARN = nil; warn("@off"); warn("@store") | ||
| 180 | local st, msg = coroutine.close(co) | 181 | local st, msg = coroutine.close(co) |
| 182 | warn("@on"); warn("@normal") | ||
| 183 | assert(_WARN == nil or string.find(_WARN, "200")) | ||
| 181 | assert(st == false and coroutine.status(co) == "dead" and msg == 111) | 184 | assert(st == false and coroutine.status(co) == "dead" and msg == 111) |
| 182 | assert(x == 200) | 185 | assert(x == 200) |
| 183 | 186 | ||
