add method

This commit is contained in:
Looly
2023-04-17 10:05:27 +08:00
parent c7be2191ae
commit 7db5d0f31f
2 changed files with 20 additions and 0 deletions

View File

@@ -284,4 +284,12 @@ public class CharSequenceUtilTest {
// Expect common suffix: { space * 10 }
Assertions.assertEquals(CharSequenceUtil.repeat(CharSequenceUtil.SPACE, 10), CharSequenceUtil.commonSuffix(str1, str2));
}
@Test
void codeLengthTest() {
String a = "🍒🐽";
final int i = StrUtil.codeLength(a);
Assertions.assertEquals(4, a.length());
Assertions.assertEquals(2, i);
}
}