From 514d94274853e6f0dfd6bb2ffa2e1fc64db926dd Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 3 Jun 2019 13:11:20 -0300 Subject: 'coroutine.kill' renamed 'coroutine.close' --- testes/coroutine.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'testes') diff --git a/testes/coroutine.lua b/testes/coroutine.lua index db6d074e..198a5870 100644 --- a/testes/coroutine.lua +++ b/testes/coroutine.lua @@ -123,23 +123,23 @@ assert(#a == 22 and a[#a] == 79) x, a = nil --- coroutine kill +-- coroutine closing do - -- ok to kill a dead coroutine + -- ok to close a dead coroutine local co = coroutine.create(print) - assert(coroutine.resume(co, "testing 'coroutine.kill'")) + assert(coroutine.resume(co, "testing 'coroutine.close'")) assert(coroutine.status(co) == "dead") - assert(coroutine.kill(co)) + assert(coroutine.close(co)) - -- cannot kill the running coroutine - local st, msg = pcall(coroutine.kill, coroutine.running()) + -- cannot close the running coroutine + local st, msg = pcall(coroutine.close, coroutine.running()) assert(not st and string.find(msg, "running")) local main = coroutine.running() - -- cannot kill a "normal" coroutine + -- cannot close a "normal" coroutine ;(coroutine.wrap(function () - local st, msg = pcall(coroutine.kill, main) + local st, msg = pcall(coroutine.close, main) assert(not st and string.find(msg, "normal")) end))() @@ -159,10 +159,10 @@ do end) coroutine.resume(co) assert(X) - assert(coroutine.kill(co)) + assert(coroutine.close(co)) assert(not X and coroutine.status(co) == "dead") - -- error killing a coroutine + -- error closing a coroutine co = coroutine.create(function() local x = func2close(function (self, err) assert(err == nil); error(111) @@ -170,7 +170,7 @@ do coroutine.yield() end) coroutine.resume(co) - local st, msg = coroutine.kill(co) + local st, msg = coroutine.close(co) assert(not st and coroutine.status(co) == "dead" and msg == 111) end -- cgit v1.2.3-55-g6feb