This commit is contained in:
Looly 2023-02-20 10:22:01 +08:00
parent 76e742ec0c
commit d6355bb241
2 changed files with 16 additions and 0 deletions

View File

@ -19,6 +19,7 @@ public class LengthFinder extends TextFinder {
* @param length 长度
*/
public LengthFinder(final int length) {
Assert.isTrue(length > 0, "Length must be great than 0");
this.length = length;
}

View File

@ -0,0 +1,15 @@
package cn.hutool.core.text;
import cn.hutool.core.text.split.SplitUtil;
import org.junit.Assert;
import org.junit.Test;
public class SplitUtilTest {
@Test
public void issueI6FKSITest(){
// issue:I6FKSI
Assert.assertThrows(IllegalArgumentException.class, () -> SplitUtil.splitByLength("test length 0", 0));
}
}