mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
add test
This commit is contained in:
parent
5f34b941fa
commit
6a79844dec
@ -46,4 +46,10 @@ public class UnicodeUtilTest {
|
||||
String res = UnicodeUtil.toString(str);
|
||||
Assert.assertEquals("{\"code\":403,\"enmsg\":\"Product not found\",\"cnmsg\":\"产品不存在,或已删除\",\"data\":null}", res);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void issueI50MI6Test(){
|
||||
String s = UnicodeUtil.toUnicode("烟", true);
|
||||
Assert.assertEquals("\\u70df", s);
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package cn.hutool.core.util;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* HexUtil单元测试
|
||||
* @author Looly
|
||||
@ -20,6 +22,12 @@ public class HexUtilTest {
|
||||
Assert.assertEquals(str, decodedStr);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void issueI50MI6Test(){
|
||||
String s = HexUtil.encodeHexStr("烟".getBytes(StandardCharsets.UTF_16BE));
|
||||
Assert.assertEquals("70df", s);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toUnicodeHexTest() {
|
||||
String unicodeHex = HexUtil.toUnicodeHex('\u2001');
|
||||
|
Loading…
x
Reference in New Issue
Block a user