mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
package org.dromara.hutool.core.text;
|
||||
|
||||
import org.dromara.hutool.core.lang.Console;
|
||||
import org.dromara.hutool.core.util.RandomUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
/**
|
||||
* 文本相似度计算工具类单元测试
|
||||
* @author looly
|
||||
*
|
||||
* @author looly
|
||||
*/
|
||||
public class TextSimilarityTest {
|
||||
|
||||
@@ -35,8 +38,20 @@ public class TextSimilarityTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void similarTest(){
|
||||
public void similarTest() {
|
||||
final double abd = TextSimilarity.similar("abd", "1111");
|
||||
Assertions.assertEquals(0, abd, 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
void longestCommonSubstringLengthTest() {
|
||||
// https://github.com/dromara/hutool/issues/3045
|
||||
final String strCommon = RandomUtil.randomString(1024 * 32);
|
||||
final String strA = RandomUtil.randomString(1024 * 32) + strCommon;
|
||||
final String strB = RandomUtil.randomString(1024 * 32) + strCommon;
|
||||
|
||||
final int i = TextSimilarity.longestCommonSubstringLength(strA, strB);
|
||||
Console.log(i);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user