Added tests for issue 249
This commit is contained in:
parent
b50277c9af
commit
200bccef21
|
@ -244,4 +244,15 @@ public class ArrayTest extends TestCase {
|
|||
assertTrue(json.contains(classWithObjectsJson));
|
||||
assertTrue(json.contains(bagOfPrimitivesJson));
|
||||
}
|
||||
|
||||
public void testArrayOfNullSerialization() {
|
||||
Object[] array = new Object[] {null};
|
||||
String json = gson.toJson(array);
|
||||
assertEquals("[null]", json);
|
||||
}
|
||||
|
||||
public void testArrayOfNullDeserialization() {
|
||||
String[] values = gson.fromJson("[null]", String[].class);
|
||||
assertNull(values[0]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue