Add test for wxString::operator<=>

This commit is contained in:
Václav Slavík
2026-03-18 17:26:03 +01:00
parent 6f935341b2
commit f972df830e
+15
View File
@@ -453,6 +453,21 @@ TEST_CASE("StringCompare", "[wxString]")
CHECK( wxString("!").Cmp("z") < 0 );
}
#ifdef __cpp_lib_three_way_comparison
TEST_CASE("StringCompareThreeWay", "[wxString]")
{
// test that operator<=> works and compares by string contents
wxString a(wxT("bar"));
wxString b(wxT("bar"));
wxString c(wxT("baz"));
CHECK((a <=> b) == std::strong_ordering::equal);
CHECK((a <=> c) == std::strong_ordering::less);
CHECK((c <=> a) == std::strong_ordering::greater);
}
#endif // __cpp_lib_three_way_comparison
TEST_CASE("StringCompareNoCase", "[wxString]")
{
wxString s1 = wxT("AHH");