Skip to content

Commit 5a573f2

Browse files
committed
leading zero is invalid, resovle json-iterator#113
1 parent 217c073 commit 5a573f2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/java/com/jsoniter/TestInteger.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ public void test_streaming() throws IOException {
8686
test_large_number();
8787
}
8888

89+
public void test_leading_zero() throws IOException {
90+
try {
91+
JsonIterator.deserialize("001", int.class);
92+
fail();
93+
} catch (JsonException e) {
94+
}
95+
}
96+
8997
private int parseInt(String input) throws IOException {
9098
if (isStreaming) {
9199
JsonIterator iter = JsonIterator.parse(new ByteArrayInputStream(input.getBytes()), 2);

0 commit comments

Comments
 (0)