Skip to content

Commit

Permalink
Remove _ from test method names
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Jan 9, 2025
1 parent b3ecf47 commit bfc2275
Showing 1 changed file with 59 additions and 59 deletions.
118 changes: 59 additions & 59 deletions src/test/java/org/apache/commons/lang3/StringUtilsTrimStripTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,48 +29,6 @@
public class StringUtilsTrimStripTest extends AbstractLangTest {
private static final String FOO = "foo";

@Test
public void testStrip_String() {
assertNull(StringUtils.strip(null));
assertEquals("", StringUtils.strip(""));
assertEquals("", StringUtils.strip(" "));
assertEquals("abc", StringUtils.strip(" abc "));
assertEquals(StringUtilsTest.NON_WHITESPACE,
StringUtils.strip(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE));
}

@Test
public void testStrip_StringString() {
// null strip
assertNull(StringUtils.strip(null, null));
assertEquals("", StringUtils.strip("", null));
assertEquals("", StringUtils.strip(" ", null));
assertEquals("abc", StringUtils.strip(" abc ", null));
assertEquals(StringUtilsTest.NON_WHITESPACE,
StringUtils.strip(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE, null));

// "" strip
assertNull(StringUtils.strip(null, ""));
assertEquals("", StringUtils.strip("", ""));
assertEquals(" ", StringUtils.strip(" ", ""));
assertEquals(" abc ", StringUtils.strip(" abc ", ""));
assertEquals(StringUtilsTest.WHITESPACE, StringUtils.strip(StringUtilsTest.WHITESPACE, ""));

// " " strip
assertNull(StringUtils.strip(null, " "));
assertEquals("", StringUtils.strip("", " "));
assertEquals("", StringUtils.strip(" ", " "));
assertEquals("abc", StringUtils.strip(" abc ", " "));

// "ab" strip
assertNull(StringUtils.strip(null, "ab"));
assertEquals("", StringUtils.strip("", "ab"));
assertEquals(" ", StringUtils.strip(" ", "ab"));
assertEquals(" abc ", StringUtils.strip(" abc ", "ab"));
assertEquals("c", StringUtils.strip("abcabab", "ab"));
assertEquals(StringUtilsTest.WHITESPACE, StringUtils.strip(StringUtilsTest.WHITESPACE, ""));
}

@Test
public void testStripAccents() {
final String cue = "\u00C7\u00FA\u00EA";
Expand All @@ -97,19 +55,6 @@ public void testStripAccents() {
"Failed to handle non-accented text");
}

/**
* Tests Unicode vulgar fractions.
*/
@Test
public void testStripAccentsUnicodeVulgarFractions() {
// 1/4, note "⁄", not "/".
assertEquals("1⁄4", StringUtils.stripAccents("\u00BC"));
// 1/2, note "⁄", not "/".
assertEquals("1⁄2", StringUtils.stripAccents("\u00BD"));
// 3/4, note "⁄", not "/".
assertEquals("3⁄4", StringUtils.stripAccents("\u00BE"));
}

@Test
public void testStripAccentsIWithBar() {
assertEquals("I i I i I", StringUtils.stripAccents("\u0197 \u0268 \u1D7B \u1DA4 \u1DA7"));
Expand All @@ -128,6 +73,19 @@ public void testStripAccentsTWithStroke() {
assertEquals("T t", StringUtils.stripAccents("\u0166 \u0167"));
}

/**
* Tests Unicode vulgar fractions.
*/
@Test
public void testStripAccentsUnicodeVulgarFractions() {
// 1/4, note "⁄", not "/".
assertEquals("1⁄4", StringUtils.stripAccents("\u00BC"));
// 1/2, note "⁄", not "/".
assertEquals("1⁄2", StringUtils.stripAccents("\u00BD"));
// 3/4, note "⁄", not "/".
assertEquals("3⁄4", StringUtils.stripAccents("\u00BE"));
}

@Test
public void testStripAccentsUWithBar() {
assertEquals("U u U u", StringUtils.stripAccents("\u0244 \u0289 \u1D7E \u1DB6"));
Expand Down Expand Up @@ -155,7 +113,7 @@ public void testStripAll() {
}

@Test
public void testStripEnd_StringString() {
public void testStripEndStringString() {
// null stripEnd
assertNull(StringUtils.stripEnd(null, null));
assertEquals("", StringUtils.stripEnd("", null));
Expand Down Expand Up @@ -187,7 +145,7 @@ public void testStripEnd_StringString() {
}

@Test
public void testStripStart_StringString() {
public void testStripStartStringString() {
// null stripStart
assertNull(StringUtils.stripStart(null, null));
assertEquals("", StringUtils.stripStart("", null));
Expand Down Expand Up @@ -219,7 +177,49 @@ public void testStripStart_StringString() {
}

@Test
public void testStripToEmpty_String() {
public void testStripString() {
assertNull(StringUtils.strip(null));
assertEquals("", StringUtils.strip(""));
assertEquals("", StringUtils.strip(" "));
assertEquals("abc", StringUtils.strip(" abc "));
assertEquals(StringUtilsTest.NON_WHITESPACE,
StringUtils.strip(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE));
}

@Test
public void testStripStringString() {
// null strip
assertNull(StringUtils.strip(null, null));
assertEquals("", StringUtils.strip("", null));
assertEquals("", StringUtils.strip(" ", null));
assertEquals("abc", StringUtils.strip(" abc ", null));
assertEquals(StringUtilsTest.NON_WHITESPACE,
StringUtils.strip(StringUtilsTest.WHITESPACE + StringUtilsTest.NON_WHITESPACE + StringUtilsTest.WHITESPACE, null));

// "" strip
assertNull(StringUtils.strip(null, ""));
assertEquals("", StringUtils.strip("", ""));
assertEquals(" ", StringUtils.strip(" ", ""));
assertEquals(" abc ", StringUtils.strip(" abc ", ""));
assertEquals(StringUtilsTest.WHITESPACE, StringUtils.strip(StringUtilsTest.WHITESPACE, ""));

// " " strip
assertNull(StringUtils.strip(null, " "));
assertEquals("", StringUtils.strip("", " "));
assertEquals("", StringUtils.strip(" ", " "));
assertEquals("abc", StringUtils.strip(" abc ", " "));

// "ab" strip
assertNull(StringUtils.strip(null, "ab"));
assertEquals("", StringUtils.strip("", "ab"));
assertEquals(" ", StringUtils.strip(" ", "ab"));
assertEquals(" abc ", StringUtils.strip(" abc ", "ab"));
assertEquals("c", StringUtils.strip("abcabab", "ab"));
assertEquals(StringUtilsTest.WHITESPACE, StringUtils.strip(StringUtilsTest.WHITESPACE, ""));
}

@Test
public void testStripToEmptyString() {
assertEquals("", StringUtils.stripToEmpty(null));
assertEquals("", StringUtils.stripToEmpty(""));
assertEquals("", StringUtils.stripToEmpty(" "));
Expand All @@ -230,7 +230,7 @@ public void testStripToEmpty_String() {
}

@Test
public void testStripToNull_String() {
public void testStripToNullString() {
assertNull(StringUtils.stripToNull(null));
assertNull(StringUtils.stripToNull(""));
assertNull(StringUtils.stripToNull(" "));
Expand Down

0 comments on commit bfc2275

Please sign in to comment.