优化测试用例

This commit is contained in:
王良 2022-01-05 15:36:02 +08:00
parent 391146425f
commit ef543c835a

View File

@ -562,8 +562,21 @@ public class StrUtilTest {
@Test
public void briefTest3() {
String str = "123abc";
int maxLength = 3;
int maxLength = 6;
String brief = StrUtil.brief(str, maxLength);
Assert.assertEquals(str, brief);
maxLength = 5;
brief = StrUtil.brief(str, maxLength);
Assert.assertEquals("1...c", brief);
maxLength = 4;
brief = StrUtil.brief(str, maxLength);
Assert.assertEquals("1..c", brief);
maxLength = 3;
brief = StrUtil.brief(str, maxLength);
Assert.assertEquals("1.c", brief);
maxLength = 2;