diff --git a/src/test/java/com/afollestad/ason/AsonSerializeTest.java b/src/test/java/com/afollestad/ason/AsonSerializeTest.java index ebbe36f..72932fb 100644 --- a/src/test/java/com/afollestad/ason/AsonSerializeTest.java +++ b/src/test/java/com/afollestad/ason/AsonSerializeTest.java @@ -104,6 +104,12 @@ public Person() { assertEquals(21, first.get("age")); } + @Test public void test_primitive_serialize() { + int[] ids = new int[]{1, 2, 3, 4}; + AsonArray array = Ason.serializeArray(ids); + assertEquals("[1,2,3,4]", array.toString()); + } + // ////// DESERIALIZE // @@ -190,4 +196,14 @@ public Person() { assertEquals(person.id, 1); assertEquals(person.age, 21); } + + @Test public void test_primitive_deserialize() { + AsonArray array = new AsonArray() + .add(1, 2, 3, 4); + int[] primitive = Ason.deserialize(array, int[].class); + assertEquals(1, primitive[0]); + assertEquals(2, primitive[1]); + assertEquals(3, primitive[2]); + assertEquals(4, primitive[3]); + } }