diff options
| author | Benoit Germain <benoit.germain@ubisoft.com> | 2025-06-05 16:03:22 +0200 |
|---|---|---|
| committer | Benoit Germain <benoit.germain@ubisoft.com> | 2025-06-05 16:03:22 +0200 |
| commit | bfdc7a92c4e3e99522abb6d90ef2cbb021f36fc8 (patch) | |
| tree | 00f6633878b21dda6cad1177d5619a501b4ac0a4 /tests/error.lua | |
| parent | f73702bcf4372a149b8b01a512c0e086b1e679e2 (diff) | |
| download | lanes-bfdc7a92c4e3e99522abb6d90ef2cbb021f36fc8.tar.gz lanes-bfdc7a92c4e3e99522abb6d90ef2cbb021f36fc8.tar.bz2 lanes-bfdc7a92c4e3e99522abb6d90ef2cbb021f36fc8.zip | |
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
Diffstat (limited to 'tests/error.lua')
| -rw-r--r-- | tests/error.lua | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/error.lua b/tests/error.lua index 28cfff1..76ceea4 100644 --- a/tests/error.lua +++ b/tests/error.lua | |||
| @@ -173,8 +173,7 @@ local do_error_catching_test = function(error_reporting_mode_, error_value_, fin | |||
| 173 | local h = start_lane(error_reporting_mode_, error_value_, finalizer_, finalizer_error_value_) | 173 | local h = start_lane(error_reporting_mode_, error_value_, finalizer_, finalizer_error_value_) |
| 174 | local ret,err,stack= h:join() -- wait for the lane (no automatic error propagation) | 174 | local ret,err,stack= h:join() -- wait for the lane (no automatic error propagation) |
| 175 | WR("Processing results for {", error_reporting_mode_, error_value_, finalizer_, finalizer_error_value_, "}") | 175 | WR("Processing results for {", error_reporting_mode_, error_value_, finalizer_, finalizer_error_value_, "}") |
| 176 | if err then | 176 | if ret == nil then |
| 177 | assert(ret == nil) | ||
| 178 | assert(error_reporting_mode_ == "minimal" or type(stack)=="table") -- only true if lane was configured with error_trace_level ~= "minimal" | 177 | assert(error_reporting_mode_ == "minimal" or type(stack)=="table") -- only true if lane was configured with error_trace_level ~= "minimal" |
| 179 | if err == error_value_ then | 178 | if err == error_value_ then |
| 180 | WR("Lane regular error: ", err) | 179 | WR("Lane regular error: ", err) |
| @@ -198,8 +197,8 @@ local do_error_catching_test = function(error_reporting_mode_, error_value_, fin | |||
| 198 | end | 197 | end |
| 199 | end | 198 | end |
| 200 | else -- no error | 199 | else -- no error |
| 201 | assert(ret == "success") | 200 | assert(ret == true and err == "success") |
| 202 | WR("No error in lane: ", ret) | 201 | WR("No error in lane: ", err, ret) |
| 203 | end | 202 | end |
| 204 | WR "TEST OK" | 203 | WR "TEST OK" |
| 205 | end | 204 | end |
