mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-23 14:45:04 +08:00
Add test for wxString::operator<=>
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user