Skip to content

Commit

Permalink
add forward_list test
Browse files Browse the repository at this point in the history
  • Loading branch information
yaito3014 committed Sep 26, 2024
1 parent 1872430 commit 33c5830
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
#include <atomic>
#include <exception>
#include <execution>
#include <forward_list>
#include <functional>
#include <list>
#include <memory>
#include <set>
#include <string>
Expand Down Expand Up @@ -685,6 +687,14 @@ BOOST_AUTO_TEST_CASE(Concat) {
BOOST_TEST(std::ranges::equal(rng, std::vector{3, 1, 4, 1, 5, 9, 2}));
BOOST_TEST(std::ranges::equal(rng | std::views::reverse, std::vector{2, 9, 5, 1, 4, 1, 3}));
}
{
std::vector vec{3, 1, 4};
std::forward_list forward_list{1, 5, 9, 2};
std::ranges::forward_range auto rng = yk::views::concat(vec, forward_list);
static_assert(!std::ranges::random_access_range<decltype(rng)>);
static_assert(!std::ranges::bidirectional_range<decltype(rng)>);
BOOST_TEST(std::ranges::equal(rng, std::vector{3, 1, 4, 1, 5, 9, 2}));
}
}

BOOST_AUTO_TEST_SUITE_END() // yk_util

0 comments on commit 33c5830

Please sign in to comment.