Skip to content

Commit

Permalink
add testcase for issue #235
Browse files Browse the repository at this point in the history
  • Loading branch information
wenshao committed May 13, 2022
1 parent 95c3e8c commit 8fb1c1f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions core/src/test/java/com/alibaba/fastjson2/issues/Issue235.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.alibaba.fastjson2.issues;

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

import java.util.List;

public class Issue235 {
@Test
public void test() {
String json = "[{\r\n"
+ " \"namespace\":\"unit07\", \r\n"
+ " \"items\":[\"COUNTER13_14.AV\",\r\n"
+ " \"COUNTER13_15.AV\"]\r\n"
+ "}\r\n"
+ "]";
JSONArray arrays = JSON.parseArray(json);
System.out.println(arrays.size());
List<TModal> list = JSON.parseArray(json, TModal.class);
System.out.println(list.size());
}

public static class TModal{
private String namespace;
private List<String> items;
}
}

0 comments on commit 8fb1c1f

Please sign in to comment.