From d0da61c285f373e3105729687af246458893d96e Mon Sep 17 00:00:00 2001 From: Lee Howes Date: Wed, 27 Dec 2017 10:07:40 -0800 Subject: [PATCH] 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 --- folly/futures/test/SemiFutureTest.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/folly/futures/test/SemiFutureTest.cpp b/folly/futures/test/SemiFutureTest.cpp index c51a6fe9..ce24b4e7 100644 --- a/folly/futures/test/SemiFutureTest.cpp +++ b/folly/futures/test/SemiFutureTest.cpp @@ -226,10 +226,15 @@ TEST(SemiFuture, MakeFutureFromSemiFutureReturnSemiFuture) { Promise p; int result{0}; auto f = p.getSemiFuture(); - auto future = std::move(f).via(&e).then([&](int value) { - result = value; - return folly::makeSemiFuture(std::move(value)); - }); + auto future = std::move(f) + .via(&e) + .then([&](int value) { + result = value; + return folly::makeSemiFuture(std::move(value)); + }) + .then([&](int value) { + return folly::makeSemiFuture(std::move(value)); + }); e.loop(); EXPECT_EQ(result, 0); EXPECT_FALSE(future.isReady()); -- 2.34.1