diff --git a/hutool-core/src/test/java/cn/hutool/core/util/StrUtilTest.java b/hutool-core/src/test/java/cn/hutool/core/util/StrUtilTest.java index 54d37836a..7c3bd2be8 100644 --- a/hutool-core/src/test/java/cn/hutool/core/util/StrUtilTest.java +++ b/hutool-core/src/test/java/cn/hutool/core/util/StrUtilTest.java @@ -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;