Skip to content

Commit 449796b

Browse files
committed
added a test for let_value's environment
1 parent 14a371a commit 449796b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/beman/execution/exec-let.test.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
#include <beman/execution/detail/let.hpp>
55
#include <beman/execution/detail/just.hpp>
6+
#include <beman/execution/detail/get_scheduler.hpp>
67
#include <beman/execution/detail/then.hpp>
8+
#include <beman/execution/detail/read_env.hpp>
79
#include <beman/execution/detail/sync_wait.hpp>
810
#include <test/execution.hpp>
911
#include <array>
@@ -105,6 +107,14 @@ auto test_let_value_allocator() -> void {
105107
// static_assert(std::same_as<void, decltype(test_std::get_completion_signatures(s, test_std::empty_env{}))>);
106108
ex::sync_wait(s);
107109
}
110+
111+
auto test_let_value_env() -> void {
112+
ex::sync_wait(
113+
ex::just()
114+
| ex::let_value([]{ return ex::read_env(ex::get_scheduler); })
115+
| ex::then([](auto s){ static_assert(ex::scheduler<decltype(s)>); })
116+
);
117+
}
108118
} // namespace
109119

110120
// ----------------------------------------------------------------------------
@@ -117,6 +127,7 @@ TEST(exec_let) {
117127
try {
118128
test_let_value();
119129
test_let_value_allocator();
130+
test_let_value_env();
120131
} catch (...) {
121132
// NOLINTBEGIN(cert-dcl03-c,hicpp-static-assert,misc-static-assert)
122133
ASSERT(nullptr == "let tests are not expected to throw");

0 commit comments

Comments
 (0)