Skip to content

Commit

Permalink
Added test for nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
Dillon Dixon committed Jul 24, 2015
1 parent a67ca05 commit 5cf82a5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions gson/src/test/java/com/google/gson/functional/JsonArrayTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,22 @@ public void testMixedPrimitiveAddition() {
assertEquals("[\"a\",\"apple\",12121,\"o\",null,null,12.232,2323]", jsonArray.toString());
}

public void testNullPrimitiveAddition() {
JsonArray jsonArray = new JsonArray();

jsonArray.add((Character) null);
jsonArray.add((Boolean) null);
jsonArray.add((Integer) null);
jsonArray.add((Double) null);
jsonArray.add((Float) null);
jsonArray.add((BigInteger) null);
jsonArray.add((String) null);
jsonArray.add((Boolean) null);
jsonArray.add((Number) null);

assertEquals("[null,null,null,null,null,null,null,null,null]", jsonArray.toString());
}

public void testSameAddition() {
JsonArray jsonArray = new JsonArray();

Expand Down

0 comments on commit 5cf82a5

Please sign in to comment.