Remove duplicate asserts in StringUtilsTest.

This commit is contained in:
shalk 2022-06-19 22:53:05 +08:00 committed by Bruno P. Kinoshita
parent 2e71945163
commit b16b93fa5f
1 changed files with 3 additions and 7 deletions

View File

@ -305,7 +305,6 @@ public class StringUtilsTest {
assertAbbreviateWithOffset("...ijklmno", 8, 10); assertAbbreviateWithOffset("...ijklmno", 8, 10);
assertAbbreviateWithOffset("...ijklmno", 9, 10); assertAbbreviateWithOffset("...ijklmno", 9, 10);
assertAbbreviateWithOffset("...ijklmno", 10, 10); assertAbbreviateWithOffset("...ijklmno", 10, 10);
assertAbbreviateWithOffset("...ijklmno", 10, 10);
assertAbbreviateWithOffset("...ijklmno", 11, 10); assertAbbreviateWithOffset("...ijklmno", 11, 10);
assertAbbreviateWithOffset("...ijklmno", 12, 10); assertAbbreviateWithOffset("...ijklmno", 12, 10);
assertAbbreviateWithOffset("...ijklmno", 13, 10); assertAbbreviateWithOffset("...ijklmno", 13, 10);
@ -1622,13 +1621,11 @@ public class StringUtilsTest {
@Test @Test
public void testRemove_char() { public void testRemove_char() {
// StringUtils.remove(null, *) = null // StringUtils.remove(null, *) = null
assertNull(StringUtils.remove(null, 'a')); assertNull(StringUtils.remove(null, null));
assertNull(StringUtils.remove(null, 'a'));
assertNull(StringUtils.remove(null, 'a')); assertNull(StringUtils.remove(null, 'a'));
// StringUtils.remove("", *) = "" // StringUtils.remove("", *) = ""
assertEquals("", StringUtils.remove("", 'a')); assertEquals("", StringUtils.remove("", null));
assertEquals("", StringUtils.remove("", 'a'));
assertEquals("", StringUtils.remove("", 'a')); assertEquals("", StringUtils.remove("", 'a'));
// StringUtils.remove("queued", 'u') = "qeed" // StringUtils.remove("queued", 'u') = "qeed"
@ -2774,7 +2771,7 @@ public class StringUtilsTest {
assertEquals("b", res[1]); assertEquals("b", res[1]);
assertEquals("c", res[2]); assertEquals("c", res[2]);
assertEquals("", res[3]); assertEquals("", res[3]);
assertEquals("", res[3]); assertEquals("", res[4]);
// Match example in javadoc // Match example in javadoc
{ {
@ -3044,7 +3041,6 @@ public class StringUtilsTest {
() -> StringUtils.truncate(null, Integer.MIN_VALUE), () -> StringUtils.truncate(null, Integer.MIN_VALUE),
"maxWith cannot be negative"); "maxWith cannot be negative");
assertEquals("", StringUtils.truncate("", 10)); assertEquals("", StringUtils.truncate("", 10));
assertEquals("", StringUtils.truncate("", 10));
assertEquals("abc", StringUtils.truncate("abcdefghij", 3)); assertEquals("abc", StringUtils.truncate("abcdefghij", 3));
assertEquals("abcdef", StringUtils.truncate("abcdefghij", 6)); assertEquals("abcdef", StringUtils.truncate("abcdefghij", 6));
assertEquals("", StringUtils.truncate("abcdefghij", 0)); assertEquals("", StringUtils.truncate("abcdefghij", 0));