Commit d0da61c2 authored by Lee Howes's avatar Lee Howes Committed by Facebook Github Bot

Add continuation to semifuture return test.

Summary: Add more detail to testing return of SemiFuture from a continuation to ensure correct behaviour.

Reviewed By: yfeldblum

Differential Revision: D6637565

fbshipit-source-id: 096a7ca140e6bdef7baab6725e86d25cf79742d8
parent 7acba7e1
...@@ -226,9 +226,14 @@ TEST(SemiFuture, MakeFutureFromSemiFutureReturnSemiFuture) { ...@@ -226,9 +226,14 @@ TEST(SemiFuture, MakeFutureFromSemiFutureReturnSemiFuture) {
Promise<int> p; Promise<int> p;
int result{0}; int result{0};
auto f = p.getSemiFuture(); auto f = p.getSemiFuture();
auto future = std::move(f).via(&e).then([&](int value) { auto future = std::move(f)
.via(&e)
.then([&](int value) {
result = value; result = value;
return folly::makeSemiFuture(std::move(value)); return folly::makeSemiFuture(std::move(value));
})
.then([&](int value) {
return folly::makeSemiFuture(std::move(value));
}); });
e.loop(); e.loop();
EXPECT_EQ(result, 0); EXPECT_EQ(result, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment