From bfdc7a92c4e3e99522abb6d90ef2cbb021f36fc8 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Thu, 5 Jun 2025 16:03:22 +0200 Subject: Change lane:join() return values * when no error is raised in the lane, lane:join() now precedes the lane returned values with true * lane body is no longer forced to return something when used with join() * adjusted all relevant unit tests accordingly --- unit_tests/scripts/coro/basics.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'unit_tests/scripts/coro') diff --git a/unit_tests/scripts/coro/basics.lua b/unit_tests/scripts/coro/basics.lua index cd2f410..c0b7a36 100644 --- a/unit_tests/scripts/coro/basics.lua +++ b/unit_tests/scripts/coro/basics.lua @@ -85,7 +85,8 @@ if true then assert(h3:resume(1) == nil) -- similarly, we can get them with join() - assert(h3:join() == "world" and h3.status == "suspended") + local r3, ret3 = h3:join() + assert(r3 == true and ret3 == "world" and h3.status == "suspended") -- since we consumed the returned values, they should not be here when we resume assert(h3:resume(2) == nil) @@ -93,5 +94,6 @@ if true then assert(h3:resume(3) == "!") -- the final return value of the lane body remains to be read - assert(h3:join() == "done!" and h3.status == "done") + local r3, ret3 = h3:join() + assert(r3 == true and ret3 == "done!" and h3.status == "done") end -- cgit v1.2.3-55-g6feb