Test that skipValue is strict on unquoted strings.

This commit is contained in:
Jesse Wilson 2011-12-21 20:40:33 +00:00
parent b5ae3c945a
commit dd9ae67af5

View File

@ -566,6 +566,16 @@ public final class JsonReaderTest extends TestCase {
}
}
public void testStrictUnquotedStringsWithSkipValue() throws IOException {
JsonReader reader = new JsonReader(new StringReader("[a]"));
reader.beginArray();
try {
reader.skipValue();
fail();
} catch (MalformedJsonException expected) {
}
}
public void testLenientUnquotedStrings() throws IOException {
JsonReader reader = new JsonReader(new StringReader("[a]"));
reader.setLenient(true);