Skip to content

Commit

Permalink
Add a test that shows when_all_range is broken
Browse files Browse the repository at this point in the history
This new test breaks because `when_all_range`'s customization of
`connect` fails to compile for `const&`-qualified senders.
  • Loading branch information
ispeters committed Sep 4, 2024
1 parent b544fc6 commit 3a70221
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/when_all_range_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <unifex/sender_concepts.hpp>
#include <unifex/sync_wait.hpp>
#include <unifex/then.hpp>
#include <unifex/v1/async_scope.hpp>

#include <unifex/never.hpp>
#include <unifex/when_all_range.hpp>
Expand Down Expand Up @@ -104,6 +105,18 @@ TEST_F(WhenAllRangeTests, noCopy) {
}
}

TEST_F(WhenAllRangeTests, canNestInV2Scope) {
// v1::async_scope::detached_spawn()'s requires clause ends up checking
// whether the provided sender can be const-ref-connected, which used to be
// broken for when_all_range
unifex::v1::async_scope scope;
std::vector<unifex::any_sender_of<int>> v;
v.push_back(unifex::just(42));
scope.detached_spawn(unifex::when_all_range(std::move(v)));

unifex::sync_wait(scope.complete());
}

// TODO: Fix MSVC compilation error with any_unique
#ifndef _MSC_VER
TEST_F(WhenAllRangeTests, ErrorCancelsRest) {
Expand Down

0 comments on commit 3a70221

Please sign in to comment.