proxygen
FilterTest.cpp File Reference

Go to the source code of this file.

Functions

 TEST (Filter, alwaysTrye)
 
 TEST (Filter, alwaysFalse)
 
 TEST (Filter, moveOnlyValue)
 

Function Documentation

TEST ( Filter  ,
alwaysTrye   
)

Definition at line 22 of file FilterTest.cpp.

References EXPECT_EQ, folly::pushmi::operators::filter, and folly::makeFuture().

22  {
23  EXPECT_EQ(42, makeFuture(42).filter([](int) { return true; }).get());
24 }
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Definition: filter.h:75
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
Future< typename std::decay< T >::type > makeFuture(T &&t)
Definition: Future-inl.h:1310
TEST ( Filter  ,
alwaysFalse   
)

Definition at line 26 of file FilterTest.cpp.

References EXPECT_THROW, folly::pushmi::operators::filter, and folly::makeFuture().

26  {
28  makeFuture(42).filter([](int) { return false; }).get(),
30 }
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Definition: filter.h:75
#define EXPECT_THROW(statement, expected_exception)
Definition: gtest.h:1843
Future< typename std::decay< T >::type > makeFuture(T &&t)
Definition: Future-inl.h:1310
TEST ( Filter  ,
moveOnlyValue   
)

Definition at line 32 of file FilterTest.cpp.

References EXPECT_EQ, folly::pushmi::operators::filter, and folly::makeFuture().

32  {
33  EXPECT_EQ(
34  42,
35  *makeFuture(std::make_unique<int>(42))
36  .filter([](std::unique_ptr<int> const&) { return true; })
37  .get());
38 }
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
Definition: filter.h:75
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
Future< typename std::decay< T >::type > makeFuture(T &&t)
Definition: Future-inl.h:1310