From 05c877f9f9353e00216a96e1e5455f249428e975 Mon Sep 17 00:00:00 2001 From: Ian Petersen Date: Wed, 4 Sep 2024 11:30:37 -0700 Subject: [PATCH] Add another broken test The previous "fix" just lies during constraint satisfaction--actually trying to const-ref-connect a `when_all_range` sender will still break. --- test/when_all_range_test.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/when_all_range_test.cpp b/test/when_all_range_test.cpp index b07a48b9..c1859be1 100644 --- a/test/when_all_range_test.cpp +++ b/test/when_all_range_test.cpp @@ -119,6 +119,22 @@ TEST_F(WhenAllRangeTests, canNestInV2Scope) { unifex::sync_wait(scope.complete()); } +TEST_F(WhenAllRangeTests, canConstRefConnect) { + using just_t = decltype(unifex::just(42)); + + const auto sender = + unifex::when_all_range(std::vector{unifex::just(42)}); + + auto ret = unifex::sync_wait(sender); + + // there should be a result + ASSERT_TRUE(ret.has_value()); + // it should be a vector of length one + ASSERT_EQ(ret->size(), 1); + // the first element should be 42 + EXPECT_EQ(ret->at(0), 42); +} + // TODO: Fix MSVC compilation error with any_unique #ifndef _MSC_VER TEST_F(WhenAllRangeTests, ErrorCancelsRest) {