diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-18 17:29:46 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-18 17:29:46 -0300 |
commit | 9405472565cb4b0cb0c339d65babdef4d4cb7abd (patch) | |
tree | 386bcb066803310f7481b60e119748c85b13d618 /testes/coroutine.lua | |
parent | 45948e7e55c753cf0e370b251ac1d4e7f3aabedd (diff) | |
download | lua-9405472565cb4b0cb0c339d65babdef4d4cb7abd.tar.gz lua-9405472565cb4b0cb0c339d65babdef4d4cb7abd.tar.bz2 lua-9405472565cb4b0cb0c339d65babdef4d4cb7abd.zip |
Improvement in warn-mode '@store' (for testing)
When using warn-mode '@store', from the test library, the tests ensure
not only that the expected warnings were issued, but also that there was
no extra warnings.
Diffstat (limited to 'testes/coroutine.lua')
-rw-r--r-- | testes/coroutine.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/testes/coroutine.lua b/testes/coroutine.lua index 79c72a9d..4fc23261 100644 --- a/testes/coroutine.lua +++ b/testes/coroutine.lua | |||
@@ -177,10 +177,15 @@ 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 | -- with test library, use 'store' mode to check warnings |
181 | warn(not T and "@off" or "@store") | ||
181 | local st, msg = coroutine.close(co) | 182 | local st, msg = coroutine.close(co) |
182 | warn("@on"); warn("@normal") | 183 | if not T then |
183 | assert(_WARN == nil or string.find(_WARN, "200")) | 184 | warn("@on") |
185 | else -- test library | ||
186 | assert(string.find(_WARN, "200")); _WARN = nil | ||
187 | warn("@normal") | ||
188 | end | ||
184 | assert(st == false and coroutine.status(co) == "dead" and msg == 111) | 189 | assert(st == false and coroutine.status(co) == "dead" and msg == 111) |
185 | assert(x == 200) | 190 | assert(x == 200) |
186 | 191 | ||