Skip to content

Commit

Permalink
🔥 remove accidentally added code
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Nov 26, 2023
1 parent 98c727e commit 405d6cc
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions tests/src/unit-comparison.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,28 +48,6 @@ template<> struct StringMaker<std::partial_ordering>
};
} // namespace doctest

#include <compare>

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
Expand Down Expand Up @@ -578,39 +556,6 @@ TEST_CASE("lexicographical comparison operators")
}
}
}

SECTION("Example operator_spaceship__scalartype.c++20")
{
using float_limits = std::numeric_limits<json::number_float_t>;
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
}

Expand Down

0 comments on commit 405d6cc

Please sign in to comment.