Go to the source code of this file.
|
| TEST (EmptyNoArgSingleSender, TapAndSubmit) |
|
| TEST (EmptyIntSingleSender, TapAndSubmit) |
|
| TEST (JustIntSingleSender, TransformAndSubmit) |
|
| TEST (FromIntManySender, TransformAndSubmit) |
|
TEST |
( |
EmptyNoArgSingleSender |
, |
|
|
TapAndSubmit |
|
|
) |
| |
Definition at line 42 of file PushmiTest.cpp.
References folly::empty(), testing::Eq(), EXPECT_THAT, EXPECT_THROW, folly::pushmi::future_from(), folly::pushmi::__adl::noexcept(), submit, folly::pushmi::operators::tap, and value.
44 using E = decltype(e);
47 <<
"expected empty to return a single sender that can take an any_receiver";
52 [&]() { signals += 100; },
53 [&](
auto)
noexcept { signals += 1000; },
54 [&]() { signals += 10; }) |
56 [&]() { signals += 100; },
57 [&](
auto)
noexcept { signals += 1000; },
58 [&]() { signals += 10; });
61 <<
"expected the done signal to be recorded twice";
64 <<
"expected future_error when future_from is applied";
69 <<
"expected future_from(e) to return std::future<void>";
#define EXPECT_THROW(statement, expected_exception)
internal::EqMatcher< T > Eq(T x)
PUSHMI_INLINE_VAR constexpr detail::tap_fn tap
requires E e noexcept(noexcept(s.error(std::move(e))))
constexpr auto empty(C const &c) -> decltype(c.empty())
requires SenderTo< In, std::promise< T >, is_single<> > std::future< T > future_from(In in)
static const char *const value
#define EXPECT_THAT(value, matcher)
TEST |
( |
EmptyIntSingleSender |
, |
|
|
TapAndSubmit |
|
|
) |
| |
Definition at line 72 of file PushmiTest.cpp.
References testing::Eq(), EXPECT_THAT, EXPECT_THROW, folly::pushmi::__adl::noexcept(), submit, folly::pushmi::operators::tap, and value.
73 auto e = op::empty<int>();
74 using E = decltype(e);
82 <<
"expected empty to return a single sender that can take an any_receiver<int>";
87 [&](
auto) { signals += 100; },
88 [&](
auto)
noexcept { signals += 1000; },
89 [&]() { signals += 10; }) |
91 [&](
auto) { signals += 100; },
92 [&](
auto)
noexcept { signals += 1000; },
93 [&]() { signals += 10; });
96 <<
"expected the done signal to be recorded twice";
98 EXPECT_THROW(v::future_from<int>(e).
get(), std::future_error)
99 <<
"expected future_error when future_from is applied";
102 (std::is_same<std::future<int>, decltype(v::future_from<int>(e))>::
value),
104 <<
"expected future_from(e) to return std::future<void>";
#define EXPECT_THROW(statement, expected_exception)
internal::EqMatcher< T > Eq(T x)
PUSHMI_INLINE_VAR constexpr detail::tap_fn tap
requires E e noexcept(noexcept(s.error(std::move(e))))
static const char *const value
#define EXPECT_THAT(value, matcher)
TEST |
( |
JustIntSingleSender |
, |
|
|
TransformAndSubmit |
|
|
) |
| |
Definition at line 107 of file PushmiTest.cpp.
References testing::Eq(), EXPECT_THAT, folly::pushmi::operators::just, folly::pushmi::__adl::noexcept(), submit, folly::pushmi::operators::transform, v, and value.
109 using J = decltype(j);
117 <<
"expected empty to return a single sender that can take an any_receiver<int>";
140 [&](
auto)
noexcept { signals += 1000; },
141 [&]() { signals += 10; });
144 <<
"expected that the transform signal is recorded twice and that the value and done signals once each";
148 auto twenty = v::future_from<int>(j).
get();
151 <<
"expected a different result from future_from(e).get()";
154 (std::is_same<std::future<int>, decltype(v::future_from<int>(j))>::value),
156 <<
"expected future_from(e) to return std::future<int>";
internal::EqMatcher< T > Eq(T x)
requires E e noexcept(noexcept(s.error(std::move(e))))
PUSHMI_INLINE_VAR constexpr detail::transform_fn transform
static const char *const value
#define EXPECT_THAT(value, matcher)
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::operators::just_fn just
TEST |
( |
FromIntManySender |
, |
|
|
TransformAndSubmit |
|
|
) |
| |
Definition at line 159 of file PushmiTest.cpp.
References testing::Eq(), EXPECT_THAT, folly::pushmi::operators::from, m, M, folly::pushmi::__adl::noexcept(), submit, folly::pushmi::operators::transform, v, and value.
160 std::array<int, 3> arr{0, 9, 99};
162 using M = decltype(
m);
167 <<
"expected empty to return a many sender that can take an any_receiver<int>";
190 [&](
auto)
noexcept { signals += 1000; },
191 [&]() { signals += 10; });
194 <<
"expected that the transform signal is recorded six times and that the value signal three times and done signal once";
196 EXPECT_THAT(value,
Eq(222)) <<
"expected a different result";
internal::EqMatcher< T > Eq(T x)
requires E e noexcept(noexcept(s.error(std::move(e))))
PUSHMI_INLINE_VAR constexpr detail::transform_fn transform
static map< string, int > m
static const char *const value
**Optimized Holders **The template hazptr_array< M > provides most of the functionality *of M hazptr_holder s but with faster construction destruction *for M
PUSHMI_INLINE_VAR constexpr struct folly::pushmi::operators::from_fn from
#define EXPECT_THAT(value, matcher)