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/linda/wake_period.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'unit_tests/scripts/linda') diff --git a/unit_tests/scripts/linda/wake_period.lua b/unit_tests/scripts/linda/wake_period.lua index e4a900d..d2dccc3 100644 --- a/unit_tests/scripts/linda/wake_period.lua +++ b/unit_tests/scripts/linda/wake_period.lua @@ -6,7 +6,7 @@ local lanes = require_lanes_result_1 local body = function(linda_) -- a blocking read that lasts longer than the tested wake_period values linda_:receive(2, "empty_slot") - return true + return "done" end -- if we don't cancel the lane, we should wait the whole duration @@ -22,7 +22,8 @@ local function check_wake_duration(linda_, expected_, do_cancel_) assert(result == false and reason == 'timeout', "unexpected cancel result") end -- this should wait until the linda wakes by itself before the actual receive timeout and sees the cancel request - h:join() + local r, ret = h:join() + assert(r == true and ret == "done") local t1 = lanes.now_secs() local delta = t1 - t0 -- the linda should check for cancellation at about the expected period, not earlier -- cgit v1.2.3-55-g6feb