Added another test to JsonParserTest.
This commit is contained in:
parent
c6f762f36b
commit
0e17041c8b
@ -58,6 +58,17 @@ public class JsonParserTest extends TestCase {
|
|||||||
assertTrue(e.isJsonNull());
|
assertTrue(e.isJsonNull());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testParseMixedArray() {
|
||||||
|
String json = "[{},13,\"stringValue\"]";
|
||||||
|
JsonElement e = parser.parse(json);
|
||||||
|
assertTrue(e.isJsonArray());
|
||||||
|
|
||||||
|
JsonArray array = e.getAsJsonArray();
|
||||||
|
assertEquals("{}", array.get(0).toString());
|
||||||
|
assertEquals(13, array.get(1).getAsInt());
|
||||||
|
assertEquals("stringValue", array.get(2).getAsString());
|
||||||
|
}
|
||||||
|
|
||||||
public void testParseReader() {
|
public void testParseReader() {
|
||||||
StringReader reader = new StringReader("{a:10,b:'c'}");
|
StringReader reader = new StringReader("{a:10,b:'c'}");
|
||||||
JsonElement e = parser.parse(reader);
|
JsonElement e = parser.parse(reader);
|
||||||
|
Loading…
Reference in New Issue
Block a user