Commit 7cb031cc authored by thebusytypist's avatar thebusytypist

Add unittests for parsing root JSON value other than array and object.

parent 76d67b7e
......@@ -1041,6 +1041,15 @@ TEST(Reader, IterativeParsing_ErrorHandling) {
TESTERRORHANDLING("{\"a\"}", kParseErrorObjectMissColon, 4u);
TESTERRORHANDLING("{\"a\": 1", kParseErrorObjectMissCommaOrCurlyBracket, 7u);
TESTERRORHANDLING("[1 2 3]", kParseErrorArrayMissCommaOrSquareBracket, 3u);
// Any JSON value can be a valid root element in RFC7159.
TESTERRORHANDLING("\"ab", kParseErrorStringMissQuotationMark, 2u);
TESTERRORHANDLING("truE", kParseErrorValueInvalid, 3u);
TESTERRORHANDLING("False", kParseErrorValueInvalid, 0u);
TESTERRORHANDLING("true, false", kParseErrorDocumentRootNotSingular, 4u);
TESTERRORHANDLING("false, false", kParseErrorDocumentRootNotSingular, 5u);
TESTERRORHANDLING("nulL", kParseErrorValueInvalid, 3u);
TESTERRORHANDLING("null , null", kParseErrorDocumentRootNotSingular, 5u);
}
template<typename Encoding = UTF8<> >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment