Skip to content

Commit

Permalink
remove future<expected<...>> test
Browse files Browse the repository at this point in the history
  • Loading branch information
yosriayed committed Apr 23, 2024
1 parent 9541438 commit 7c76ebd
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions test/future.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,35 +672,6 @@ TEST_CASE("future: void type")
CHECK(v == 42);
}

TEST_CASE("future: expected type")
{
auto promise = plz::make_promise<std::expected<int, std::string>>();

auto future = promise.get_future();

// Simulating an asynchronous task
std::thread(
[promise]() mutable
{
std::this_thread::sleep_for(std::chrono::milliseconds(100));
promise.set_result(42);
})
.detach();

auto value = future
.then(
[](auto value)
{
return value.value() + 1;
})
.then(
[](auto v)
{
return v;
})
.get(); // Wait for the entire chain to complete
}

TEST_CASE("future: multiple futures")
{
std::array promises = {
Expand Down

0 comments on commit 7c76ebd

Please sign in to comment.