Lines Matching refs:JSONReader
228 std::unique_ptr<Value> root = JSONReader::ReadAndReturnError( in TEST_F()
236 root = JSONReader::ReadAndReturnError(big_json, JSON_PARSE_RFC, &error_code, in TEST_F()
239 EXPECT_EQ(JSONParser::FormatErrorMessage(5, 10, JSONReader::kSyntaxError), in TEST_F()
241 EXPECT_EQ(JSONReader::JSON_SYNTAX_ERROR, error_code); in TEST_F()
249 root = JSONReader::ReadAndReturnError(big_json_crlf, JSON_PARSE_RFC, in TEST_F()
252 EXPECT_EQ(JSONParser::FormatErrorMessage(5, 10, JSONReader::kSyntaxError), in TEST_F()
254 EXPECT_EQ(JSONReader::JSON_SYNTAX_ERROR, error_code); in TEST_F()
257 root = JSONReader::ReadAndReturnError("{},{}", JSON_PARSE_RFC, &error_code, in TEST_F()
261 JSONReader::kUnexpectedDataAfterRoot), error_message); in TEST_F()
262 EXPECT_EQ(JSONReader::JSON_UNEXPECTED_DATA_AFTER_ROOT, error_code); in TEST_F()
269 root = JSONReader::ReadAndReturnError(nested_json, JSON_PARSE_RFC, in TEST_F()
272 EXPECT_EQ(JSONParser::FormatErrorMessage(1, 200, JSONReader::kTooMuchNesting), in TEST_F()
274 EXPECT_EQ(JSONReader::JSON_TOO_MUCH_NESTING, error_code); in TEST_F()
276 root = JSONReader::ReadAndReturnError("[1,]", JSON_PARSE_RFC, &error_code, in TEST_F()
279 EXPECT_EQ(JSONParser::FormatErrorMessage(1, 4, JSONReader::kTrailingComma), in TEST_F()
281 EXPECT_EQ(JSONReader::JSON_TRAILING_COMMA, error_code); in TEST_F()
283 root = JSONReader::ReadAndReturnError("{foo:\"bar\"}", JSON_PARSE_RFC, in TEST_F()
287 JSONReader::kUnquotedDictionaryKey), error_message); in TEST_F()
288 EXPECT_EQ(JSONReader::JSON_UNQUOTED_DICTIONARY_KEY, error_code); in TEST_F()
290 root = JSONReader::ReadAndReturnError("{\"foo\":\"bar\",}", JSON_PARSE_RFC, in TEST_F()
293 EXPECT_EQ(JSONParser::FormatErrorMessage(1, 14, JSONReader::kTrailingComma), in TEST_F()
296 root = JSONReader::ReadAndReturnError("[nu]", JSON_PARSE_RFC, &error_code, in TEST_F()
299 EXPECT_EQ(JSONParser::FormatErrorMessage(1, 2, JSONReader::kSyntaxError), in TEST_F()
301 EXPECT_EQ(JSONReader::JSON_SYNTAX_ERROR, error_code); in TEST_F()
303 root = JSONReader::ReadAndReturnError("[\"xxx\\xq\"]", JSON_PARSE_RFC, in TEST_F()
306 EXPECT_EQ(JSONParser::FormatErrorMessage(1, 7, JSONReader::kInvalidEscape), in TEST_F()
308 EXPECT_EQ(JSONReader::JSON_INVALID_ESCAPE, error_code); in TEST_F()
310 root = JSONReader::ReadAndReturnError("[\"xxx\\uq\"]", JSON_PARSE_RFC, in TEST_F()
313 EXPECT_EQ(JSONParser::FormatErrorMessage(1, 7, JSONReader::kInvalidEscape), in TEST_F()
315 EXPECT_EQ(JSONReader::JSON_INVALID_ESCAPE, error_code); in TEST_F()
317 root = JSONReader::ReadAndReturnError("[\"xxx\\q\"]", JSON_PARSE_RFC, in TEST_F()
320 EXPECT_EQ(JSONParser::FormatErrorMessage(1, 7, JSONReader::kInvalidEscape), in TEST_F()
322 EXPECT_EQ(JSONReader::JSON_INVALID_ESCAPE, error_code); in TEST_F()
324 root = JSONReader::ReadAndReturnError(("[\"\\ufffe\"]"), JSON_PARSE_RFC, in TEST_F()
326 EXPECT_EQ(JSONParser::FormatErrorMessage(1, 8, JSONReader::kInvalidEscape), in TEST_F()
328 EXPECT_EQ(JSONReader::JSON_INVALID_ESCAPE, error_code); in TEST_F()
338 std::unique_ptr<Value> root = JSONReader::ReadAndReturnError( in TEST_F()
346 EXPECT_FALSE(JSONReader::Read("[\"\\ufdd0\"]")); in TEST_F()
347 EXPECT_FALSE(JSONReader::Read("[\"\\ufffe\"]")); in TEST_F()
348 EXPECT_FALSE(JSONReader::Read("[\"\\ud83f\\udffe\"]")); in TEST_F()
351 JSONReader::Read("[\"\\ufdd0\"]", JSON_REPLACE_INVALID_CHARACTERS)); in TEST_F()
353 JSONReader::Read("[\"\\ufffe\"]", JSON_REPLACE_INVALID_CHARACTERS)); in TEST_F()
357 EXPECT_FALSE(JSONReader::Read("[\"\\x-A\"]")); in TEST_F()
358 EXPECT_FALSE(JSONReader::Read("[\"\\u-00A\"]")); in TEST_F()
412 std::unique_ptr<Value> result = JSONReader::Read(input); in TEST_F()
457 EXPECT_FALSE(JSONReader::Read(input)); in TEST_F()