From 6f9a81678654bcc5d1e1299bf1666c20178bdb0f Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 23 Dec 2023 10:02:42 -0800 Subject: [PATCH] Enable test --- test/ranges-test.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/test/ranges-test.cc b/test/ranges-test.cc index c161fbc4..8ab66b33 100644 --- a/test/ranges-test.cc +++ b/test/ranges-test.cc @@ -384,17 +384,6 @@ struct cpp20_only_range { }; static_assert(std::input_iterator); - -# ifdef __cpp_lib_ranges_iota -TEST(ranges_test, nested_ranges) { - auto l = std::list{1, 2, 3}; - auto r = std::views::iota(0, 3) | std::views::transform([&l](auto i) { - return std::views::take(std::ranges::subrange(l), i); - }) | - std::views::transform(std::views::reverse); - EXPECT_EQ(fmt::format("{}", r), "[[], [1], [2, 1]]"); -} -# endif # endif TEST(ranges_test, join_sentinel) { @@ -433,6 +422,17 @@ TEST(ranges_test, join_range) { } #endif // FMT_RANGES_TEST_ENABLE_JOIN +#if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 202302L +TEST(ranges_test, nested_ranges) { + auto l = std::list{1, 2, 3}; + auto r = std::views::iota(0, 3) | std::views::transform([&l](auto i) { + return std::views::take(std::ranges::subrange(l), i); + }) | + std::views::transform(std::views::reverse); + EXPECT_EQ(fmt::format("{}", r), "[[], [1], [2, 1]]"); +} +#endif + TEST(ranges_test, is_printable) { using fmt::detail::is_printable; EXPECT_TRUE(is_printable(0x0323));