Skip to content

Commit 0d893a4

Browse files
authored
Merge pull request #8 from noahra/issue/#7
test - add serialization test (#7)
2 parents 7fc8851 + 4766703 commit 0d893a4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/java/com/jsoniter/TestRecord.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.jsoniter;
22

3+
import com.jsoniter.output.JsonStream;
4+
import junit.framework.Test;
35
import junit.framework.TestCase;
46

57
import java.io.IOException;
@@ -15,4 +17,8 @@ public void test_record_error() throws IOException {
1517
JsonIterator iter = JsonIterator.parse("{ 'field1' : 1".replace('\'', '"'));
1618
iter.read(TestRecord1.class);
1719
}
20+
21+
public void test_record_serialize(){
22+
assertEquals("{\"field1\":1}",JsonStream.serialize(new TestRecord1(1)));
23+
}
1824
}

0 commit comments

Comments
 (0)