Skip to content

Commit f1eb609

Browse files
added a test for let_value's environment (#175)
* added a test for `let_value`'s environment * clang-format * Update tests/beman/execution/exec-let.test.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent d82ccca commit f1eb609

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 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,11 @@ 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(ex::just() | ex::let_value([] { return ex::read_env(ex::get_scheduler); }) |
113+
ex::then([](auto s) { static_assert(ex::scheduler<decltype(s)>); }));
114+
}
108115
} // namespace
109116

110117
// ----------------------------------------------------------------------------
@@ -117,6 +124,7 @@ TEST(exec_let) {
117124
try {
118125
test_let_value();
119126
test_let_value_allocator();
127+
test_let_value_env();
120128
} catch (...) {
121129
// NOLINTBEGIN(cert-dcl03-c,hicpp-static-assert,misc-static-assert)
122130
ASSERT(nullptr == "let tests are not expected to throw");

0 commit comments

Comments
 (0)