This commit is contained in:
looly
2022-01-05 18:45:45 +08:00
parent 24569b81c8
commit f8017c31d5
4 changed files with 17 additions and 7 deletions

View File

@@ -0,0 +1,15 @@
package cn.hutool.core.text;
import cn.hutool.core.lang.Dict;
import org.junit.Assert;
import org.junit.Test;
public class NamingCaseTest {
@Test
public void toUnderlineCaseTest(){
// https://github.com/dromara/hutool/issues/2070
Dict.create()
.set("customerNickV2", "customer_nick_v2")
.forEach((key, value) -> Assert.assertEquals(value, NamingCase.toUnderlineCase(key)));
}
}

View File

@@ -421,12 +421,6 @@ public class StrUtilTest {
.set("HelloWorld_test", "hello_world_test")
.set("H2", "H2")
.set("H#case", "H#case")
.forEach((key, value) -> Assert.assertEquals(value, StrUtil.toUnderlineCase(key)));
}
@Test
public void toUnderLineCaseTest2() {
Dict.create()
.set("PNLabel", "PN_label")
.forEach((key, value) -> Assert.assertEquals(value, StrUtil.toUnderlineCase(key)));
}