mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复JSONStrFormatter:format函数对于转义符号处理逻辑错误问题
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class IssueI84V6ITest {
|
||||
@Test
|
||||
public void formatTest() {
|
||||
final String a1 = "{'x':'\\n','y':','}";
|
||||
final String formatJsonStr = JSONUtil.formatJsonStr(a1);
|
||||
// Console.log(formatJsonStr);
|
||||
Assert.assertEquals(
|
||||
"{\n" +
|
||||
" 'x': '\\n',\n" +
|
||||
" 'y': ','\n" +
|
||||
"}", formatJsonStr);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user