Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
jianwu committed Jul 8, 2023
1 parent 19bb640 commit 49fd4b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public class TDJSONParser {
public TDNode parseAll(CharSource src) { return parseAll(src, new TDJSONOption()); }
public TDNode parseAll(String str, TDJSONOption opt) { return parseAll(new ArrayCharSource(str), opt); }
/** Parse all the JSON objects in the input stream until EOF and store them inside a root node with array type */
public TDNode parseAll(CharSource src, TDJSONOption opt) {
public TDNode parseAll(CharSource src, TDJSONOption option) {
TDJSONOption opt = option.setDefaultRootType(TDNode.Type.MAP);
TreeDoc doc = TreeDoc.ofArray();
int docId = 0;
while(src.skipSpacesAndReturnsAndCommas())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private static void parseWithException(String str, String expectedError) {
TestCls test = new TestCls("va", new TestCls1(23, new String[]{"a", "b"}));
String str = test.toString(); // TDJsonParserTest.TestCls(a=va, c=TDJsonParserTest.TestCls1(d=23, strs=[a, b]))
TDJSONOption opt = new TDJSONOption().setDeliminatorObject("(", ")").setDeliminatorKey("=");
testParse(str, opt, "{$type:\"TDJsonParserTest.TestCls\",a:\"va\",c:{$type:\"TDJsonParserTest.TestCls1\",d:23,strs:[\"a\",\"b\"]}}");
testParse(str, opt, "{$type:'TDJsonParserTest.TestCls',a:'va',c:{$type:'TDJsonParserTest.TestCls1',d:23,strs:['a','b']}}");
}

@Test public void testParsePathCompression() {
Expand Down

0 comments on commit 49fd4b6

Please sign in to comment.