Skip to content

Commit

Permalink
improve testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed Oct 28, 2023
1 parent 9259319 commit d4c5410
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
package com.alibaba.fastjson2.v1issues.issue_1900;

import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.JSONWriter;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class Issue1919 {
@Test
public void test() {
StringBuilder buf = new StringBuilder("{\"precedeId\":1.");
for (int i = 0; i < 2500; i++) {
buf.append('0');
}
String a = buf.append("}").toString();
JSON.parseObject(a);
String str = buf.append("}").toString();
JSONObject jsonObject = JSON.parseObject(str);
assertEquals(str, jsonObject.toJSONString(JSONWriter.Feature.WriteBigDecimalAsPlain));
}
}

0 comments on commit d4c5410

Please sign in to comment.