PragmaTwice commented on PR #33912:
URL: https://github.com/apache/arrow/pull/33912#issuecomment-1409709656
> Let's add a unit test (below requires including `arrow/util/functional.h`):
>
> ```
> TEST(ResultTest, ValueOrGeneratedMoveOnlyGenerator) {
> Result<MoveOnlyDataType> result = Status::Invalid("");
> internal::FnOnce<MoveOnlyDataType()> alternative_generator = [] {
> return MoveOnlyDataType{kIntElement};
> };
> auto out =
std::move(result).ValueOrElse(std::move(alternative_generator));
> EXPECT_EQ(*out.data, kIntElement);
> }
> ```
>
> I'll point out that `ValueOrElse` is not used at all within the code base
(other than in unit tests) but this concern seems legitimate.
So thanks! Added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]