mirror of
https://github.com/alibaba/fastjson.git
synced 2026-10-29 14:10:25 +08:00
add testcase
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.alibaba.json.bvt;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.junit.Assert;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
|
||||
public class MapRefTest6 extends TestCase {
|
||||
|
||||
public void test_0() throws Exception {
|
||||
List<Map<Object, Object>> list = JSON.parseObject("[{},{\"$\":\"$[0]\"},{\"$001\":\"101\"},{\"$r01\":\"102\"},{\"$re1\":\"103\"}]",
|
||||
new TypeReference<List<Map<Object, Object>>>() {
|
||||
});
|
||||
Assert.assertEquals(5, list.size());
|
||||
Assert.assertEquals(true, ((Map)list.get(0)).isEmpty());
|
||||
Assert.assertEquals("$[0]", ((Map)list.get(1)).get("$"));
|
||||
Assert.assertEquals("101", ((Map)list.get(2)).get("$001"));
|
||||
Assert.assertEquals("102", ((Map)list.get(3)).get("$r01"));
|
||||
Assert.assertEquals("103", ((Map)list.get(4)).get("$re1"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user