This is an automated email from the ASF dual-hosted git repository. garydgregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-lang.git
commit cba3a601052629002618e102f310690d27361014 Author: Gary Gregory <[email protected]> AuthorDate: Wed Jun 10 18:40:45 2026 -0400 Sort members --- .../java/org/apache/commons/lang3/StringsTest.java | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/test/java/org/apache/commons/lang3/StringsTest.java b/src/test/java/org/apache/commons/lang3/StringsTest.java index 650b43e20..4eaea90b9 100644 --- a/src/test/java/org/apache/commons/lang3/StringsTest.java +++ b/src/test/java/org/apache/commons/lang3/StringsTest.java @@ -59,6 +59,19 @@ void testCaseInsensitiveConstant() { assertFalse(Strings.CI.isCaseSensitive()); } + /** + * {@code U+0130} lower-cases to the two-char sequence {@code "i̇"} outside Turkish locales, so pre-lower-casing the + * search argument made the case-insensitive replace look for a two-char needle that no longer matches the single source + * character. + */ + @Test + @DefaultLocale("en") + void testCaseInsensitiveReplaceLengthChangingLowerCase() { + assertEquals("aXb", Strings.CI.replace("aİb", "İ", "X", -1)); + assertEquals("x_y_z", Strings.CI.replace("xİyİz", "İ", "_", -1)); + assertEquals("X", Strings.CI.replaceOnce("İ", "İ", "X")); + } + /** * Expanding the existing test group {@link StringUtilsStartsEndsWithTest#testStartsWithAny()} to include case-insensitive cases */ @@ -80,19 +93,6 @@ void testCaseInsensitiveStartsWithAny() { assertTrue(Strings.CI.startsWithAny(new StringBuffer("AbCxYz"), new StringBuilder("XyZ"), new StringBuffer("abc"))); } - /** - * {@code U+0130} lower-cases to the two-char sequence {@code "i̇"} outside Turkish locales, so pre-lower-casing the - * search argument made the case-insensitive replace look for a two-char needle that no longer matches the single source - * character. - */ - @Test - @DefaultLocale("en") - void testCaseInsensitiveReplaceLengthChangingLowerCase() { - assertEquals("aXb", Strings.CI.replace("aİb", "İ", "X", -1)); - assertEquals("x_y_z", Strings.CI.replace("xİyİz", "İ", "_", -1)); - assertEquals("X", Strings.CI.replaceOnce("İ", "İ", "X")); - } - @Test void testCaseSensitiveConstant() { assertNotNull(Strings.CS);
