diff options
Diffstat (limited to 'testes/coroutine.lua')
-rw-r--r-- | testes/coroutine.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/testes/coroutine.lua b/testes/coroutine.lua index 35ff27fb..9dd501e7 100644 --- a/testes/coroutine.lua +++ b/testes/coroutine.lua | |||
@@ -346,9 +346,13 @@ do | |||
346 | local st, res = coroutine.resume(B) | 346 | local st, res = coroutine.resume(B) |
347 | assert(st == true and res == false) | 347 | assert(st == true and res == false) |
348 | 348 | ||
349 | A = coroutine.wrap(function() return pcall(A, 1) end) | 349 | local X = false |
350 | A = coroutine.wrap(function() | ||
351 | local *toclose _ = setmetatable({}, {__close = function () X = true end}) | ||
352 | return pcall(A, 1) | ||
353 | end) | ||
350 | st, res = A() | 354 | st, res = A() |
351 | assert(not st and string.find(res, "non%-suspended")) | 355 | assert(not st and string.find(res, "non%-suspended") and X == true) |
352 | end | 356 | end |
353 | 357 | ||
354 | 358 | ||