diff options
Diffstat (limited to 'testes/coroutine.lua')
-rw-r--r-- | testes/coroutine.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/testes/coroutine.lua b/testes/coroutine.lua index 02536ee5..4881d964 100644 --- a/testes/coroutine.lua +++ b/testes/coroutine.lua | |||
@@ -158,6 +158,11 @@ do | |||
158 | 158 | ||
159 | local main = coroutine.running() | 159 | local main = coroutine.running() |
160 | 160 | ||
161 | -- cannot close 'main' | ||
162 | local st, msg = pcall(coroutine.close, main); | ||
163 | assert(not st and string.find(msg, "main")) | ||
164 | |||
165 | |||
161 | -- cannot close a "normal" coroutine | 166 | -- cannot close a "normal" coroutine |
162 | ;(coroutine.wrap(function () | 167 | ;(coroutine.wrap(function () |
163 | local st, msg = pcall(coroutine.close, main) | 168 | local st, msg = pcall(coroutine.close, main) |