• Home
  • Raw
  • Download

Lines Matching full:json

2 //  __|  |   __|     |   | |  JSON for Modern C++ (supporting code)
4 // |_____|_____|_____|_|___| https://github.com/nlohmann/json
12 #include <nlohmann/json.hpp>
13 using nlohmann::json;
37 bool number_integer(json::number_integer_t val) in number_integer()
43 bool number_unsigned(json::number_unsigned_t val) in number_unsigned()
49 bool number_float(json::number_float_t /*unused*/, const std::string& s) in number_float()
61 bool binary(json::binary_t& val) in binary()
120 …bool parse_error(std::size_t position, const std::string& /*unused*/, const json::exception& /*unu… in parse_error()
131 class SaxCountdown : public nlohmann::json::json_sax_t
147 bool number_integer(json::number_integer_t /*val*/) override in number_integer()
152 bool number_unsigned(json::number_unsigned_t /*val*/) override in number_unsigned()
157 bool number_float(json::number_float_t /*val*/, const std::string& /*s*/) override in number_float()
167 bool binary(json::binary_t& /*val*/) override in binary()
197 …bool parse_error(std::size_t /*position*/, const std::string& /*last_token*/, const json::exceptio… in parse_error()
206 json parser_helper(const std::string& s);
210 json parser_helper(const std::string& s) in parser_helper()
212 json j; in parser_helper()
213 json::parser(nlohmann::detail::input_adapter(s)).parse(true, j); in parser_helper()
217 json j_nothrow; in parser_helper()
218 …CHECK_NOTHROW(json::parser(nlohmann::detail::input_adapter(s), nullptr, false).parse(true, j_nothr… in parser_helper()
221 json j_sax; in parser_helper()
222 nlohmann::detail::json_sax_dom_parser<json> sdp(j_sax); in parser_helper()
223 json::sax_parse(s, &sdp); in parser_helper()
236 json j; in accept_helper()
237 CHECK_NOTHROW(json::parser(nlohmann::detail::input_adapter(s), nullptr, false).parse(true, j)); in accept_helper()
241 const bool ok_accept = json::parser(nlohmann::detail::input_adapter(s)).accept(true); in accept_helper()
248 CHECK_NOTHROW(json::sax_parse(s, &el, json::input_format_t::json, false)); in accept_helper()
249 CHECK(json::parser(nlohmann::detail::input_adapter(s)).accept(false) == !el.errored); in accept_helper()
252json::parser_callback_t const cb = [](int /*unused*/, json::parse_event_t /*unused*/, json& /*unus… in accept_helper()
256 json const j_cb = json::parse(s, cb, false); in accept_helper()
274 json _; in comments_helper()
277 CHECK_NOTHROW(_ = json::parse(s)); in comments_helper()
278 CHECK(json::accept(s)); in comments_helper()
281 CHECK_NOTHROW(_ = json::parse(s, nullptr, false, true)); in comments_helper()
282 CHECK(json::accept(s, true)); in comments_helper()
297 CHECK_THROWS_AS(_ = json::parse(json_with_comment), json::parse_error); in comments_helper()
298 CHECK(!json::accept(json_with_comment)); in comments_helper()
300 CHECK_NOTHROW(_ = json::parse(json_with_comment, nullptr, true, true)); in comments_helper()
301 CHECK(json::accept(json_with_comment, true)); in comments_helper()
313 CHECK(parser_helper("null") == json(nullptr));
318 CHECK(parser_helper("true") == json(true));
323 CHECK(parser_helper("false") == json(false));
330 CHECK(parser_helper("[]") == json(json::value_t::array));
331 CHECK(parser_helper("[ ]") == json(json::value_t::array));
336 CHECK(parser_helper("[true, false, null]") == json({true, false, nullptr}));
344 CHECK(parser_helper("{}") == json(json::value_t::object));
345 CHECK(parser_helper("{ }") == json(json::value_t::object));
350 …CHECK(parser_helper("{\"\": true, \"one\": 1, \"two\": null}") == json({{"", true}, {"one", 1}, {"…
357 CHECK(parser_helper("\"\"") == json(json::value_t::string));
362json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
364json.exception.parse_error.101] parse error at line 2, column 0: syntax error while parsing value …
365json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
367json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
369 CHECK_THROWS_AS(parser_helper("\uFF01"), json::parse_error&);
370 CHECK_THROWS_AS(parser_helper("[-4:1,]"), json::parse_error&);
372json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
373json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
374json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
375json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
376json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
377json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
378json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
379json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
380json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
381json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
382json.exception.parse_error.101] parse error at line 2, column 0: syntax error while parsing value …
383json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
384json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
385json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
386json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
387json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
388json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
389json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
390json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
391json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
392json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
393json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
394json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
395json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
396json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
397json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
398json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
399json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
400json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
401json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
402json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
403json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
413 json _;
414json::parse(s.begin(), s.end()), "[json.exception.parse_error.101] parse error at line 1, column 2…
429 CHECK(parser_helper("\"\\b\"") == json("\b"));
431 CHECK(parser_helper("\"\\f\"") == json("\f"));
433 CHECK(parser_helper("\"\\n\"") == json("\n"));
435 CHECK(parser_helper("\"\\r\"") == json("\r"));
437 CHECK(parser_helper("\"\\t\"") == json("\t"));
439 CHECK(parser_helper("\"\\u0001\"").get<json::string_t>() == "\x01");
440 CHECK(parser_helper("\"\\u000a\"").get<json::string_t>() == "\n");
441 CHECK(parser_helper("\"\\u00b0\"").get<json::string_t>() == "°");
442 CHECK(parser_helper("\"\\u0c00\"").get<json::string_t>() == "ఀ");
443 CHECK(parser_helper("\"\\ud000\"").get<json::string_t>() == "퀀");
444 CHECK(parser_helper("\"\\u000E\"").get<json::string_t>() == "\x0E");
445 CHECK(parser_helper("\"\\u00F0\"").get<json::string_t>() == "ð");
446 CHECK(parser_helper("\"\\u0100\"").get<json::string_t>() == "Ā");
447 CHECK(parser_helper("\"\\u2000\"").get<json::string_t>() == " ");
448 CHECK(parser_helper("\"\\uFFFF\"").get<json::string_t>() == "￿");
449 CHECK(parser_helper("\"\\u20AC\"").get<json::string_t>() == "€");
450 CHECK(parser_helper("\"€\"").get<json::string_t>() == "€");
451 CHECK(parser_helper("\"��\"").get<json::string_t>() == "��");
453 … CHECK(parser_helper("\"\\ud80c\\udc60\"").get<json::string_t>() == "\xf0\x93\x81\xa0");
454 CHECK(parser_helper("\"\\ud83c\\udf1e\"").get<json::string_t>() == "��");
464 CHECK(parser_helper("-128") == json(-128));
465 CHECK(parser_helper("-0") == json(-0));
466 CHECK(parser_helper("0") == json(0));
467 CHECK(parser_helper("128") == json(128));
472 CHECK(parser_helper("0e1") == json(0e1));
473 CHECK(parser_helper("0E1") == json(0e1));
475 CHECK(parser_helper("10000E-4") == json(10000e-4));
476 CHECK(parser_helper("10000E-3") == json(10000e-3));
477 CHECK(parser_helper("10000E-2") == json(10000e-2));
478 CHECK(parser_helper("10000E-1") == json(10000e-1));
479 CHECK(parser_helper("10000E0") == json(10000e0));
480 CHECK(parser_helper("10000E1") == json(10000e1));
481 CHECK(parser_helper("10000E2") == json(10000e2));
482 CHECK(parser_helper("10000E3") == json(10000e3));
483 CHECK(parser_helper("10000E4") == json(10000e4));
485 CHECK(parser_helper("10000e-4") == json(10000e-4));
486 CHECK(parser_helper("10000e-3") == json(10000e-3));
487 CHECK(parser_helper("10000e-2") == json(10000e-2));
488 CHECK(parser_helper("10000e-1") == json(10000e-1));
489 CHECK(parser_helper("10000e0") == json(10000e0));
490 CHECK(parser_helper("10000e1") == json(10000e1));
491 CHECK(parser_helper("10000e2") == json(10000e2));
492 CHECK(parser_helper("10000e3") == json(10000e3));
493 CHECK(parser_helper("10000e4") == json(10000e4));
495 CHECK(parser_helper("-0e1") == json(-0e1));
496 CHECK(parser_helper("-0E1") == json(-0e1));
497 CHECK(parser_helper("-0E123") == json(-0e123));
500 CHECK(parser_helper("10E0") == json(10e0));
501 CHECK(parser_helper("10E1") == json(10e1));
502 CHECK(parser_helper("10E2") == json(10e2));
503 CHECK(parser_helper("10E3") == json(10e3));
504 CHECK(parser_helper("10E4") == json(10e4));
505 CHECK(parser_helper("10E5") == json(10e5));
506 CHECK(parser_helper("10E6") == json(10e6));
507 CHECK(parser_helper("10E7") == json(10e7));
508 CHECK(parser_helper("10E8") == json(10e8));
509 CHECK(parser_helper("10E9") == json(10e9));
510 CHECK(parser_helper("10E+0") == json(10e0));
511 CHECK(parser_helper("10E+1") == json(10e1));
512 CHECK(parser_helper("10E+2") == json(10e2));
513 CHECK(parser_helper("10E+3") == json(10e3));
514 CHECK(parser_helper("10E+4") == json(10e4));
515 CHECK(parser_helper("10E+5") == json(10e5));
516 CHECK(parser_helper("10E+6") == json(10e6));
517 CHECK(parser_helper("10E+7") == json(10e7));
518 CHECK(parser_helper("10E+8") == json(10e8));
519 CHECK(parser_helper("10E+9") == json(10e9));
520 CHECK(parser_helper("10E-1") == json(10e-1));
521 CHECK(parser_helper("10E-2") == json(10e-2));
522 CHECK(parser_helper("10E-3") == json(10e-3));
523 CHECK(parser_helper("10E-4") == json(10e-4));
524 CHECK(parser_helper("10E-5") == json(10e-5));
525 CHECK(parser_helper("10E-6") == json(10e-6));
526 CHECK(parser_helper("10E-7") == json(10e-7));
527 CHECK(parser_helper("10E-8") == json(10e-8));
528 CHECK(parser_helper("10E-9") == json(10e-9));
567 CHECK(parser_helper("-128.5") == json(-128.5));
568 CHECK(parser_helper("0.999") == json(0.999));
569 CHECK(parser_helper("128.5") == json(128.5));
570 CHECK(parser_helper("-0.0") == json(-0.0));
575 CHECK(parser_helper("-128.5E3") == json(-128.5E3));
576 CHECK(parser_helper("-128.5E-3") == json(-128.5E-3));
577 CHECK(parser_helper("-0.0e1") == json(-0.0e1));
578 CHECK(parser_helper("-0.0E1") == json(-0.0e1));
585 …r_helper("1.18973e+4932").empty(), "[json.exception.out_of_range.406] number overflow parsing '1.1…
591 CHECK_THROWS_AS(parser_helper("+1"), json::parse_error&);
592 CHECK_THROWS_AS(parser_helper("+0"), json::parse_error&);
595json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
597json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
599json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
601json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
603json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
605json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value …
607json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
609json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value …
611json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value …
613json.exception.parse_error.101] parse error at line 1, column 5: syntax error while parsing value …
615json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
617 …"[json.exception.parse_error.101] parse error at line 1, column 5: syntax error while parsing valu…
619json.exception.parse_error.101] parse error at line 1, column 5: syntax error while parsing value …
621 …"[json.exception.parse_error.101] parse error at line 1, column 7: syntax error while parsing valu…
623json.exception.parse_error.101] parse error at line 1, column 6: syntax error while parsing value …
625json.exception.parse_error.101] parse error at line 1, column 5: syntax error while parsing value …
627json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value …
898json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
900json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
902json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
904json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value …
906json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
908json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
910json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
912 …"[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing valu…
914json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
916json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
918json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
920json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
922json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
924json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing value …
928 …"[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing valu…
930 …"[json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing valu…
932 …"[json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing valu…
934 …"[json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing valu…
936 …"[json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing valu…
940 …"[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing valu…
942 …"[json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing valu…
944 …"[json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing valu…
946 …"[json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing valu…
948 …"[json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing valu…
952 …"[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing valu…
954 …"[json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing valu…
956 …"[json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing valu…
958 …"[json.exception.parse_error.101] parse error at line 1, column 5: syntax error while parsing valu…
960 …"[json.exception.parse_error.101] parse error at line 1, column 5: syntax error while parsing valu…
962 …"[json.exception.parse_error.101] parse error at line 1, column 5: syntax error while parsing valu…
966json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
968 …"[json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing arra…
970json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value …
972json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value …
974json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value …
978json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing object…
980json.exception.parse_error.101] parse error at line 1, column 7: syntax error while parsing object…
982json.exception.parse_error.101] parse error at line 1, column 8: syntax error while parsing value …
984json.exception.parse_error.101] parse error at line 1, column 8: syntax error while parsing value …
986json.exception.parse_error.101] parse error at line 1, column 10: syntax error while parsing objec…
988json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value …
992json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value …
994json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value …
996json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value …
998json.exception.parse_error.101] parse error at line 1, column 5: syntax error while parsing value …
1000json.exception.parse_error.101] parse error at line 1, column 6: syntax error while parsing value …
1002json.exception.parse_error.101] parse error at line 1, column 7: syntax error while parsing value …
1004json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing value …
1006json.exception.parse_error.101] parse error at line 1, column 5: syntax error while parsing value …
1008json.exception.parse_error.101] parse error at line 1, column 6: syntax error while parsing value …
1010json.exception.parse_error.101] parse error at line 1, column 7: syntax error while parsing value …
1042 CHECK_THROWS_AS(parser_helper(s), json::parse_error&);
1047 …"[json.exception.parse_error.101] parse error at line 1, column 3: syntax error while parsing valu…
1118 CHECK_THROWS_AS(parser_helper(s1), json::parse_error&);
1123 …"[json.exception.parse_error.101] parse error at line 1, column 7: syntax error while parsing valu…
1127 CHECK_THROWS_AS(parser_helper(s2), json::parse_error&);
1132 …"[json.exception.parse_error.101] parse error at line 1, column 6: syntax error while parsing valu…
1136 CHECK_THROWS_AS(parser_helper(s3), json::parse_error&);
1141 …"[json.exception.parse_error.101] parse error at line 1, column 5: syntax error while parsing valu…
1145 CHECK_THROWS_AS(parser_helper(s4), json::parse_error&);
1150 …"[json.exception.parse_error.101] parse error at line 1, column 4: syntax error while parsing valu…
1156 json _;
1159json::parse("\"\\uD80C\""), "[json.exception.parse_error.101] parse error at line 1, column 8: syn…
1161 CHECK_THROWS_WITH_AS(_ = json::parse("\"\\uD80C\\uD80C\""),
1162json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value…
1163 CHECK_THROWS_WITH_AS(_ = json::parse("\"\\uD80C\\u0000\""),
1164json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value…
1165 CHECK_THROWS_WITH_AS(_ = json::parse("\"\\uD80C\\uFFFF\""),
1166json.exception.parse_error.101] parse error at line 1, column 13: syntax error while parsing value…
1250 CHECK(json::parser(nlohmann::detail::input_adapter(s)).accept());
1263 CHECK(json::parser(nlohmann::detail::input_adapter(s)).accept() == false);
1322 CHECK(json::parser(nlohmann::detail::input_adapter(s1)).accept());
1324 CHECK(json::parser(nlohmann::detail::input_adapter(s2)).accept());
1326 CHECK(json::parser(nlohmann::detail::input_adapter(s3)).accept());
1328 CHECK(json::parser(nlohmann::detail::input_adapter(s4)).accept());
1333 CHECK(json::parser(nlohmann::detail::input_adapter(s1)).accept() == false);
1336 CHECK(json::parser(nlohmann::detail::input_adapter(s2)).accept() == false);
1339 CHECK(json::parser(nlohmann::detail::input_adapter(s3)).accept() == false);
1342 CHECK(json::parser(nlohmann::detail::input_adapter(s4)).accept() == false);
1358 …[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing objec…
1360 … "[json.exception.parse_error.101] parse error at line 1, column 19: syntax error while parsing ob…
1364json::parser_callback_t const cb = [](int /*unused*/, json::parse_event_t event, json& /*unused*/)…
1366 return event != json::parse_event_t::key; in __anon9dc15d840502()
1369 json x = json::parse("{\"key\": false}", cb);
1370 CHECK(x == json::object());
1403json j_object = json::parse(s_object, [](int /*unused*/, json::parse_event_t /*unused*/, const jso…
1408 CHECK (j_object == json({{"foo", 2}, {"bar", {{"baz", 1}}}}));
1410json j_array = json::parse(s_array, [](int /*unused*/, json::parse_event_t /*unused*/, const json&…
1415 CHECK (j_array == json({1, 2, {3, 4, 5}, 4, 5}));
1420json const j_object = json::parse(s_object, [](int /*unused*/, json::parse_event_t /*unused*/, con…
1428json const j_array = json::parse(s_array, [](int /*unused*/, json::parse_event_t /*unused*/, const…
1439json j_object = json::parse(s_object, [](int /*unused*/, json::parse_event_t event, const json & j…
1442 return event != json::parse_event_t::value || j != json(2); in __anon9dc15d840a02()
1445 CHECK (j_object == json({{"bar", {{"baz", 1}}}}));
1447json j_array = json::parse(s_array, [](int /*unused*/, json::parse_event_t event, const json & j) …
1449 return event != json::parse_event_t::value || j != json(2); in __anon9dc15d840b02()
1452 CHECK (j_array == json({1, {3, 4, 5}, 4, 5}));
1457json j_filtered1 = json::parse(structured_array, [](int /*unused*/, json::parse_event_t e, const j…
1459 return !(e == json::parse_event_t::object_end && parsed.contains("foo")); in __anon9dc15d840c02()
1464 CHECK (j_filtered1 == json({1, {{"qux", "baz"}}}));
1466json j_filtered2 = json::parse(structured_array, [](int /*unused*/, json::parse_event_t e, const j…
1468 return e != json::parse_event_t::object_end; in __anon9dc15d840d02()
1473 CHECK (j_filtered2 == json({1}));
1481json j_object = json::parse(s_object, [](int /*unused*/, json::parse_event_t e, const json& /*unus…
1484 if (e == json::parse_event_t::object_end && first) in __anon9dc15d840e02()
1494 CHECK (j_object == json({{"foo", 2}}));
1498json j_array = json::parse(s_array, [](int /*unused*/, json::parse_event_t e, const json& /*unused…
1501 if (e == json::parse_event_t::array_end && first) in __anon9dc15d840f02()
1511 CHECK (j_array == json({1, 2, 4, 5}));
1522json j_empty_object = json::parse("{}", [](int /*unused*/, json::parse_event_t e, const json& /*un…
1524 return e != json::parse_event_t::object_end; in __anon9dc15d841002()
1526 CHECK(j_empty_object == json());
1528json j_empty_array = json::parse("[]", [](int /*unused*/, json::parse_event_t e, const json& /*unu…
1530 return e != json::parse_event_t::array_end; in __anon9dc15d841102()
1532 CHECK(j_empty_array == json());
1541 json j;
1542json::parser(nlohmann::detail::input_adapter(std::begin(v), std::end(v))).parse(true, j);
1543 CHECK(j == json(true));
1549 json j;
1550json::parser(nlohmann::detail::input_adapter(std::begin(v), std::end(v))).parse(true, j);
1551 CHECK(j == json(true));
1557 json j;
1558json::parser(nlohmann::detail::input_adapter(std::begin(v), std::end(v))).parse(true, j);
1559 CHECK(j == json(true));
1564 CHECK(parser_helper("true") == json(true));
1570 json j;
1571json::parser(nlohmann::detail::input_adapter(std::begin(v), std::end(v))).parse(true, j);
1572 CHECK(j == json(true));
1578 json j;
1579json::parser(nlohmann::detail::input_adapter(std::begin(v), std::end(v))).parse(true, j);
1580 CHECK(j == json(true));
1586 json j;
1587json::parser(nlohmann::detail::input_adapter(std::begin(v), std::end(v))).parse(true, j);
1588 CHECK(j == json(true));
1596json::parser_callback_t const cb = [](int /*unused*/, json::parse_event_t /*unused*/, json& /*unus…
1601 CHECK(json::parse("{\"foo\": true:", cb, false).is_discarded());
1603 json _;
1604json::parse("{\"foo\": true:", cb), "[json.exception.parse_error.101] parse error at line 1, colum…
1606 …THROWS_WITH_AS(_ = json::parse("1.18973e+4932", cb), "[json.exception.out_of_range.406] number ove…
1614 CHECK(json::sax_parse("{}", &s) == false);
1620 CHECK(json::sax_parse("{\"k1\": true}", &s) == false);
1626 CHECK(json::sax_parse("{\"k1\": true, \"k2\": false}", &s) == false);
1632 CHECK(json::sax_parse("[]", &s) == false);
1638 CHECK(json::sax_parse("[1]", &s) == false);
1644 CHECK(json::sax_parse("3.14", &s) == false);
1650 CHECK(json::sax_parse("false", &s) == false);
1656 CHECK(json::sax_parse("null", &s) == false);
1662 CHECK(json::sax_parse("true", &s) == false);
1668 CHECK(json::sax_parse("12", &s) == false);
1674 CHECK(json::sax_parse("-12", &s) == false);
1680 CHECK(json::sax_parse("\"foo\"", &s) == false);
1687 json _;
1688json::parse("/a", nullptr, true, true), "[json.exception.parse_error.101] parse error at line 1, c…
1689json::parse("/*", nullptr, true, true), "[json.exception.parse_error.101] parse error at line 1, c…