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 --- tests/pingpong.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tests/pingpong.lua') diff --git a/tests/pingpong.lua b/tests/pingpong.lua index 06c0903..1ed5b9a 100644 --- a/tests/pingpong.lua +++ b/tests/pingpong.lua @@ -21,13 +21,15 @@ local pingpong = function(name, qr, qs, start) q:send(qs, val) count = count + 1 end - return true + return "ping!" end -- pingpong("L1", '0', '1', true) local t1, err1 = lanes.gen("*", { name = 'auto' }, pingpong)("L1", 'a', 'b', true) local t2, err2 = lanes.gen("*", { name = 'auto' }, pingpong)("L2", 'b', 'a', false) -t1:join() -t2:join() +local r1, ret1 = t1:join() +assert(r1 == true and ret1 == "ping!") +local r2, ret2 = t2:join() +assert(r2 == true and ret2 == "ping!") print "TEST OK" -- cgit v1.2.3-55-g6feb