Do not use wxRegEx in wxCmpNaturalGeneric()
Using wxRegEx in wxCmpNaturalGeneric() introduced a dependency of the base library on the regex library. Replace wxRegEx with character classification functions wxIsspace(), wxIspunct(), and wxIsdigit() to remove this rather unnecessary dependency. Closes https://github.com/wxWidgets/wxWidgets/pull/2014
This commit is contained in:
@@ -784,9 +784,6 @@ void ArraysTestCase::IndexFromEnd()
|
||||
|
||||
TEST_CASE("wxNaturalStringComparisonGeneric()", "[wxString][compare]")
|
||||
{
|
||||
#if !wxUSE_REGEX
|
||||
WARN("Skipping wxCmpNaturalGeneric() tests: wxRegEx not available");
|
||||
#else
|
||||
// simple string comparison
|
||||
CHECK(wxCmpNaturalGeneric("a", "a") == 0);
|
||||
CHECK(wxCmpNaturalGeneric("a", "z") < 0);
|
||||
@@ -858,6 +855,5 @@ TEST_CASE("wxNaturalStringComparisonGeneric()", "[wxString][compare]")
|
||||
CHECK(wxCmpNaturalGeneric("a5th5", "a10th10") < 0);
|
||||
CHECK(wxCmpNaturalGeneric("a 10th 10", "a5th 5") < 0);
|
||||
CHECK(wxCmpNaturalGeneric("a5th 5", "a 10th 10") > 0);
|
||||
#endif // #if !wxUSE_REGEX
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user