add PasswdStrength

This commit is contained in:
Looly
2021-06-29 00:04:48 +08:00
parent 1472cdc440
commit 2034b59042
4 changed files with 336 additions and 3 deletions

View File

@@ -0,0 +1,12 @@
package cn.hutool.core.text;
import org.junit.Assert;
import org.junit.Test;
public class PasswdStrengthTest {
@Test
public void strengthTest(){
String passwd = "2hAj5#mne-ix.86H";
Assert.assertEquals(13, PasswdStrength.check(passwd));
}
}

View File

@@ -518,4 +518,16 @@ public class StrUtilTest {
Assert.assertEquals("jackduan@163.com", StrUtil.hide("jackduan@163.com", 16, 17));
}
@Test
public void isCharEqualsTest(){
String a = "aaaaaaaaa";
Assert.assertTrue(StrUtil.isCharEquals(a));
}
@Test
public void isNumericTest(){
String a = "2142342422423423";
Assert.assertTrue(StrUtil.isNumeric(a));
}
}