Skip to content

Commit b874880

Browse files
update adaptor test
1 parent 01fd829 commit b874880

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

libcxx/test/std/ranges/range.adaptors/range.concat/adaptor.pass.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,28 @@ constexpr void compareViews(View v, std::initializer_list<int> list) {
4848
}
4949

5050
constexpr bool test() {
51-
int buff[] = {0, 1, 2, 3, 4, 5, 6, 7};
51+
int arr[] = {0, 1, 2, 3};
52+
int arr2[] = {4, 5, 6, 7};
5253

5354
{
54-
Range range(buff, buff + 8);
55+
Range range(arr, arr + 4);
5556

5657
{
5758
decltype(auto) result = std::views::concat(range);
59+
compareViews(result, {0, 1, 2, 3});
60+
ASSERT_SAME_TYPE(decltype(std::views::all(range)), decltype(result));
61+
}
62+
}
63+
64+
{
65+
Range first(arr, arr + 4);
66+
Range tail(arr2, arr2 + 4);
67+
68+
{
69+
decltype(auto) result = std::views::concat(first, tail);
5870
compareViews(result, {0, 1, 2, 3, 4, 5, 6, 7});
71+
using Type = std::ranges::concat_view<Range, Range>;
72+
ASSERT_SAME_TYPE(Type, decltype(result));
5973
}
6074
}
6175

0 commit comments

Comments
 (0)