diff --git a/tests/src/unit-comparison.cpp b/tests/src/unit-comparison.cpp index ac59ebcc0..786ea2026 100644 --- a/tests/src/unit-comparison.cpp +++ b/tests/src/unit-comparison.cpp @@ -48,28 +48,6 @@ template<> struct StringMaker }; } // namespace doctest -#include - -namespace -{ -const char* to_string(const std::partial_ordering& po) -{ - if (std::is_lt(po)) - { - return "less"; - } - else if (std::is_gt(po)) - { - return "greater"; - } - else if (std::is_eq(po)) - { - return "equivalent"; - } - return "unordered"; -} -} - #endif namespace @@ -578,39 +556,6 @@ TEST_CASE("lexicographical comparison operators") } } } - - SECTION("Example operator_spaceship__scalartype.c++20") - { - using float_limits = std::numeric_limits; - constexpr auto nan = float_limits::quiet_NaN(); - - // create several JSON values - json boolean = false; - json number = 17; - json string = "17"; - - CHECK(to_string(boolean <= > true) == "less"); - CHECK(to_string(number <= > 17.0) == "equivalent"); - CHECK(to_string(number <= > nan) == "unordered"); - CHECK(to_string(string <= > 17) == "greater"); - } - - SECTION("Example operator_spaceship__const_reference.c++20") - { - // create several JSON values - json array_1 = {1, 2, 3}; - json array_2 = {1, 2, 4}; - json object_1 = {{"A", "a"}, {"B", "b"}}; - json object_2 = {{"B", "b"}, {"A", "a"}}; - json number = 17; - json string = "foo"; - json discarded = json(json::value_t::discarded); - - CHECK(to_string(array_1 <= > array_2) == "less"); - CHECK(to_string(object_1 <= > object_2) == "equivalent"); - CHECK(to_string(string <= > number) == "greater"); - CHECK(to_string(string <= > discarded) == "unordered"); - } #endif }