当用户选择ignoreError时,错误对象转JSON也忽略

This commit is contained in:
Looly
2023-03-26 09:01:50 +08:00
parent b884cdaedd
commit 6394b41cb1
2 changed files with 16 additions and 2 deletions

View File

@@ -31,6 +31,16 @@ public class JSONUtilTest {
Console.log(jsonArray);
}
/**
* 数字解析为JSONArray报错
*/
@Test
public void parseNumberToJSONArrayTest2() {
final JSONArray json = JSONUtil.parseArray(123L,
JSONConfig.create().setIgnoreError(true));
Assert.assertNotNull(json);
}
/**
* 数字解析为JSONArray报错
*/