kokkos-execution 0.0.1
Loading...
Searching...
No Matches
test_check_rcvr_env.cpp
Go to the documentation of this file.
1#include "gtest/gtest.h"
2
4
15
16namespace Tests {
17
18constexpr struct PropA : public ::stdexec::__query<PropA> {
20
21constexpr struct PropB : public ::stdexec::__query<PropB> {
23
24consteval auto get_sndr() {
25 using expected_env_t = stdexec::env<
26 const stdexec::prop<Tests::PropA, double>&,
27 stdexec::__env::__fwd<stdexec::env<
28 const stdexec::__env::__fwd<stdexec::prop<Tests::PropB, double>>&,
29 stdexec::__env::__fwd<stdexec::__sync_wait::__env>
30 >>
31 >;
32
33 return stdexec::just() | Tests::Utils::check_rcvr_env<expected_env_t>()
34 | stdexec::write_env(stdexec::prop{prop_a, 42.}) | stdexec::then([]() { })
35 | stdexec::write_env(stdexec::__fwd_env(stdexec::prop{prop_b, 666.}));
36}
37
39TEST(check_rcvr_env, rvalue) {
40 stdexec::sync_wait(get_sndr());
41}
42
44TEST(check_rcvr_env, lvalue) {
45 auto sndr = get_sndr();
46 stdexec::sync_wait(sndr);
47}
48
49} // namespace Tests
constexpr check_rcvr_env_t< ExpectedEnv > check_rcvr_env
consteval auto get_sndr()
Tests::PropA prop_a
Tests::PropB prop_b