tests/unit-iterators2: use std::ranges::equals for range comparisons

This fixes a build error on GCC 13:

  /home/arsen/nlohmann_json/tests/src/unit-iterators2.cpp: In function ‘void _DOCTEST_ANON_FUNC_2()’:
  /home/arsen/nlohmann_json/tests/src/unit-iterators2.cpp:946:32: error: no match for ‘operator==’ (operand types are ‘doctest::detail::Expression_lhs<std::ranges::reverse_view<std::ranges::ref_view<nlohmann::json_abi_v3_11_2::basic_json<> > >&>’ and ‘nlohmann::json_abi_v3_11_2::json’ {aka ‘nlohmann::json_abi_v3_11_2::basic_json<>’})
    946 |                 CHECK(reversed == j_expected);
        |                                ^~ ~~~~~~~~~~
        |                                   |
        |                                   nlohmann::json_abi_v3_11_2::json {aka nlohmann::json_abi_v3_11_2::basic_json<>}

Bug: https://bugs.gentoo.org/895692
Closes: #3927
This commit is contained in:
Arsen Arsenović 2023-02-21 12:59:21 +01:00 committed by Arsen Arsenović
parent b2306145e1
commit a49829bd98
No known key found for this signature in database
GPG Key ID: 52C294301EA2C493

View File

@ -943,7 +943,7 @@ TEST_CASE("iterators 2")
json j_expected{5, 4, 3, 2, 1};
auto reversed = j | std::views::reverse;
CHECK(reversed == j_expected);
CHECK(std::ranges::equal(reversed, j_expected));
}
SECTION("transform")