feat: Move/copy support in async framework (#1609)

Fixes #1608
This commit is contained in:
Alex Kremer
2024-08-20 13:24:51 +01:00
committed by GitHub
parent fb473f6d28
commit 9a9de501e4
18 changed files with 290 additions and 54 deletions

View File

@@ -27,6 +27,7 @@
#include <any>
#include <expected>
#include <string>
#include <utility>
using namespace util::async;
using namespace ::testing;
@@ -47,6 +48,14 @@ struct AnyOperationTests : Test {
};
using AnyOperationDeathTest = AnyOperationTests;
TEST_F(AnyOperationTests, Move)
{
EXPECT_CALL(mockOp, get()).WillOnce(Return(std::any{}));
auto yoink = std::move(voidOp);
auto res = yoink.get();
ASSERT_TRUE(res);
}
TEST_F(AnyOperationTests, VoidDataYieldsNoError)
{
EXPECT_CALL(mockOp, get()).WillOnce(Return(std::any{}));