Skip to content

Commit a202012

Browse files
committed
fixed a problem with env in sync_wait (and fixed the tests)
1 parent 38c8d98 commit a202012

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

include/beman/execution26/detail/sync_wait.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct sync_wait_env {
3232
auto query(::beman::execution26::get_delegation_scheduler_t) const noexcept { return this->loop->get_scheduler(); }
3333
};
3434

35-
template <::beman::execution26::sender_in Sender>
35+
template <::beman::execution26::sender_in<::beman::execution26::detail::sync_wait_env> Sender>
3636
using sync_wait_result_type =
3737
::std::optional<::beman::execution26::value_types_of_t<Sender,
3838
::beman::execution26::detail::sync_wait_env,

tests/beman/execution26/exec-sync-wait.test.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#include <beman/execution26/detail/sender.hpp>
1414
#include <beman/execution26/detail/sender_in.hpp>
1515
#include <beman/execution26/detail/just.hpp>
16+
#include <beman/execution26/detail/read_env.hpp>
17+
#include <beman/execution26/detail/get_delegation_scheduler.hpp>
18+
#include <beman/execution26/detail/then.hpp>
1619
#include <test/execution.hpp>
1720

1821
#include <exception>
@@ -225,12 +228,12 @@ auto test_sync_wait() -> void {
225228
}
226229

227230
auto test_provides_scheduler() -> void {
228-
ASSERT(test_std::sync_wait(test_std::then(test_std::read_env(test_std::get_scheduler()), [](auto&&) noexcept {})));
231+
ASSERT(test_std::sync_wait(test_std::then(test_std::read_env(test_std::get_scheduler), [](auto&&) noexcept {})));
229232
}
230233

231234
auto test_provides_delegation_scheduler() -> void {
232235
ASSERT(test_std::sync_wait(
233-
test_std::then(test_std::read_env(test_std::get_delegation_scheduler()), [](auto&&) noexcept {})));
236+
test_std::then(test_std::read_env(test_std::get_delegation_scheduler), [](auto&&) noexcept {})));
234237
}
235238
} // namespace
236239

@@ -245,4 +248,6 @@ TEST(exec_sync_wait) {
245248
test_sync_wait_state();
246249
test_sync_wait_receiver();
247250
test_sync_wait();
251+
test_provides_scheduler();
252+
test_provides_delegation_scheduler();
248253
}

0 commit comments

Comments
 (0)