Lines Matching refs:JSONReader

25   std::unique_ptr<Value> root = JSONReader().ReadToValue("   null   ");  in TEST()
31 EXPECT_FALSE(JSONReader().ReadToValue("nu")); in TEST()
35 std::unique_ptr<Value> root = JSONReader().ReadToValue("true "); in TEST()
41 std::unique_ptr<Value> root = JSONReader().ReadToValue("/* comment */null"); in TEST()
44 root = JSONReader().ReadToValue("40 /* comment */"); in TEST()
47 root = JSONReader().ReadToValue("true // comment"); in TEST()
50 root = JSONReader().ReadToValue("/* comment */\"sample string\""); in TEST()
57 ListValue::From(JSONReader().ReadToValue("[1, /* comment, 2 ] */ \n 3]")); in TEST()
65 list = ListValue::From(JSONReader().ReadToValue("[1, /*a*/2, 3]")); in TEST()
68 root = JSONReader().ReadToValue("/* comment **/42"); in TEST()
73 root = JSONReader().ReadToValue( in TEST()
84 std::unique_ptr<Value> root = JSONReader().ReadToValue("43"); in TEST()
94 EXPECT_FALSE(JSONReader().ReadToValue("043")); in TEST()
95 EXPECT_FALSE(JSONReader().ReadToValue("0x43")); in TEST()
96 EXPECT_FALSE(JSONReader().ReadToValue("00")); in TEST()
102 std::unique_ptr<Value> root = JSONReader().ReadToValue("0"); in TEST()
113 std::unique_ptr<Value> root = JSONReader().ReadToValue("2147483648"); in TEST()
120 root = JSONReader().ReadToValue("-2147483649"); in TEST()
129 std::unique_ptr<Value> root = JSONReader().ReadToValue("43.1"); in TEST()
136 root = JSONReader().ReadToValue("4.3e-1"); in TEST()
143 root = JSONReader().ReadToValue("2.1e0"); in TEST()
150 root = JSONReader().ReadToValue("2.1e+0001"); in TEST()
157 root = JSONReader().ReadToValue("0.01"); in TEST()
164 root = JSONReader().ReadToValue("1.00"); in TEST()
174 EXPECT_FALSE(JSONReader().ReadToValue("1.")); in TEST()
175 EXPECT_FALSE(JSONReader().ReadToValue(".1")); in TEST()
176 EXPECT_FALSE(JSONReader().ReadToValue("1.e10")); in TEST()
181 EXPECT_FALSE(JSONReader().ReadToValue("1e")); in TEST()
182 EXPECT_FALSE(JSONReader().ReadToValue("1E")); in TEST()
183 EXPECT_FALSE(JSONReader().ReadToValue("1e1.")); in TEST()
184 EXPECT_FALSE(JSONReader().ReadToValue("1e1.0")); in TEST()
188 EXPECT_FALSE(JSONReader().ReadToValue("1e1000")); in TEST()
189 EXPECT_FALSE(JSONReader().ReadToValue("-1e1000")); in TEST()
190 EXPECT_FALSE(JSONReader().ReadToValue("NaN")); in TEST()
191 EXPECT_FALSE(JSONReader().ReadToValue("nan")); in TEST()
192 EXPECT_FALSE(JSONReader().ReadToValue("inf")); in TEST()
196 EXPECT_FALSE(JSONReader().ReadToValue("4.3.1")); in TEST()
197 EXPECT_FALSE(JSONReader().ReadToValue("4e3.1")); in TEST()
198 EXPECT_FALSE(JSONReader().ReadToValue("4.a")); in TEST()
201 TEST(JSONReader, SimpleString) { in TEST() argument
202 std::unique_ptr<Value> root = JSONReader().ReadToValue("\"hello world\""); in TEST()
211 std::unique_ptr<Value> root = JSONReader().ReadToValue("\"\""); in TEST()
221 JSONReader().ReadToValue("\" \\\"\\\\\\/\\b\\f\\n\\r\\t\\v\""); in TEST()
232 JSONReader().ReadToValue("\"\\x41\\x00\\u1234\\u0000\""); in TEST()
241 EXPECT_FALSE(JSONReader().ReadToValue("\"no closing quote")); in TEST()
242 EXPECT_FALSE(JSONReader().ReadToValue("\"\\z invalid escape char\"")); in TEST()
243 EXPECT_FALSE(JSONReader().ReadToValue("\"\\xAQ invalid hex code\"")); in TEST()
244 EXPECT_FALSE(JSONReader().ReadToValue("not enough hex chars\\x1\"")); in TEST()
245 EXPECT_FALSE(JSONReader().ReadToValue("\"not enough escape chars\\u123\"")); in TEST()
247 JSONReader().ReadToValue("\"extra backslash at end of input\\\"")); in TEST()
252 ListValue::From(JSONReader::Read("[true, false, null]")); in TEST()
258 JSONReader::Read("[true, false, null, ]", JSON_ALLOW_TRAILING_COMMAS); in TEST()
263 std::unique_ptr<ListValue> list = ListValue::From(JSONReader::Read("[]")); in TEST()
270 JSONReader::Read("[[true], [], [false, [], [null]], null]")); in TEST()
276 JSONReader::Read("[[true], [], [false, [], [null, ] , ], null,]", in TEST()
283 EXPECT_FALSE(JSONReader::Read("[[true], [], [false, [], [null]], null")); in TEST()
286 EXPECT_FALSE(JSONReader::Read("[true,, null]")); in TEST()
287 EXPECT_FALSE(JSONReader::Read("[true,, null]", JSON_ALLOW_TRAILING_COMMAS)); in TEST()
290 EXPECT_FALSE(JSONReader::Read("[true null]")); in TEST()
293 EXPECT_FALSE(JSONReader::Read("[true,]")); in TEST()
299 ListValue::From(JSONReader::Read("[true,]", JSON_ALLOW_TRAILING_COMMAS)); in TEST()
313 EXPECT_FALSE(JSONReader::Read("[,]", JSON_ALLOW_TRAILING_COMMAS)); in TEST()
314 EXPECT_FALSE(JSONReader::Read("[true,,]", JSON_ALLOW_TRAILING_COMMAS)); in TEST()
315 EXPECT_FALSE(JSONReader::Read("[,true,]", JSON_ALLOW_TRAILING_COMMAS)); in TEST()
316 EXPECT_FALSE(JSONReader::Read("[true,,false]", JSON_ALLOW_TRAILING_COMMAS)); in TEST()
321 DictionaryValue::From(JSONReader::Read("{}")); in TEST()
326 auto dict_val = DictionaryValue::From(JSONReader::Read( in TEST()
339 std::unique_ptr<Value> root2 = JSONReader::Read( in TEST()
346 root2 = JSONReader::Read( in TEST()
356 root2 = JSONReader::Read( in TEST()
369 DictionaryValue::From(JSONReader::Read( in TEST()
383 std::unique_ptr<Value> root2 = JSONReader::Read( in TEST()
391 JSONReader::Read("{\"a.b\":3,\"c\":2,\"d.e.f\":{\"g.h.i.j\":1}}")); in TEST()
407 DictionaryValue::From(JSONReader::Read("{\"a\":{\"b\":2},\"a.b\":1}")); in TEST()
417 EXPECT_FALSE(JSONReader::Read("{\"a\": true")); in TEST()
420 EXPECT_FALSE(JSONReader::Read("{foo:true}")); in TEST()
421 EXPECT_FALSE(JSONReader::Read("{1234: false}")); in TEST()
422 EXPECT_FALSE(JSONReader::Read("{:false}")); in TEST()
425 EXPECT_FALSE(JSONReader::Read("{\"a\":true,}")); in TEST()
428 EXPECT_FALSE(JSONReader::Read("{\"a\":true,,\"b\":false}")); in TEST()
429 EXPECT_FALSE(JSONReader::Read("{\"a\":true,,\"b\":false}", in TEST()
433 EXPECT_FALSE(JSONReader::Read("{\"a\" \"b\"}")); in TEST()
436 EXPECT_FALSE(JSONReader::Read("{,}")); in TEST()
437 EXPECT_FALSE(JSONReader::Read("{,}", JSON_ALLOW_TRAILING_COMMAS)); in TEST()
438 EXPECT_FALSE(JSONReader::Read("{\"a\":true,,}", JSON_ALLOW_TRAILING_COMMAS)); in TEST()
439 EXPECT_FALSE(JSONReader::Read("{,\"a\":true}", JSON_ALLOW_TRAILING_COMMAS)); in TEST()
440 EXPECT_FALSE(JSONReader::Read("{\"a\":true,,\"b\":false}", in TEST()
447 EXPECT_FALSE(JSONReader::Read(evil)); in TEST()
455 std::unique_ptr<ListValue> list = ListValue::From(JSONReader::Read(not_evil)); in TEST()
462 JSONReader().ReadToValue("\"\xe7\xbd\x91\xe9\xa1\xb5\""); in TEST()
470 DictionaryValue::From(JSONReader().ReadToValue( in TEST()
478 EXPECT_FALSE(JSONReader().ReadToValue("\"345\xb0\xa1\xb0\xa2\"")); in TEST()
479 EXPECT_FALSE(JSONReader().ReadToValue("\"123\xc0\x81\"")); in TEST()
480 EXPECT_FALSE(JSONReader().ReadToValue("\"abc\xc0\xae\"")); in TEST()
484 std::unique_ptr<Value> root = JSONReader().ReadToValue("\"\\u20ac3,14\""); in TEST()
494 root = JSONReader().ReadToValue("\"\\ud83d\\udca9\\ud83d\\udc6c\""); in TEST()
519 root = JSONReader().ReadToValue(cases[i]); in TEST()
525 std::unique_ptr<Value> root = JSONReader::Read("null"); in TEST()
529 root = JSONReader::Read("true"); in TEST()
535 root = JSONReader::Read("10"); in TEST()
541 root = JSONReader::Read("\"root\""); in TEST()
557 JSONReader reader; in TEST()
574 std::unique_ptr<Value> root = JSONReader::Read( in TEST()
640 JSONReader reader; in TEST()
643 EXPECT_NE(JSONReader::JSON_NO_ERROR, reader.error_code()); in TEST()
651 JSONReader reader; in TEST()
653 EXPECT_EQ(JSONReader::JSON_UNEXPECTED_DATA_AFTER_ROOT, reader.error_code()); in TEST()
659 root = JSONReader::Read(json, JSON_PARSE_RFC, 3); in TEST()
661 root = JSONReader::Read(json, JSON_PARSE_RFC, 4); in TEST()