• Home
  • Raw
  • Download

Lines Matching full:json

3  __|  |   __|     |   | |  JSON for Modern C++ (test suite)
5 |_____|_____|_____|_|___| https://github.com/nlohmann/json
33 #include <nlohmann/json.hpp>
34 using nlohmann::json;
62 bool number_integer(json::number_integer_t) in number_integer()
67 bool number_unsigned(json::number_unsigned_t) in number_unsigned()
72 bool number_float(json::number_float_t, const std::string&) in number_float()
112 bool parse_error(std::size_t, const std::string&, const json::exception&) in parse_error()
129 json j = json::value_t::discarded;
130 const auto result = json::to_cbor(j);
137 json j = std::numeric_limits<json::number_float_t>::quiet_NaN();
139 const auto result = json::to_cbor(j);
146 json j = std::numeric_limits<json::number_float_t>::infinity();
148 const auto result = json::to_cbor(j);
154 json j = nullptr;
156 const auto result = json::to_cbor(j);
160 CHECK(json::from_cbor(result) == j);
161 CHECK(json::from_cbor(result, true, false) == j);
168 json j = true;
170 const auto result = json::to_cbor(j);
174 CHECK(json::from_cbor(result) == j);
175 CHECK(json::from_cbor(result, true, false) == j);
180 json j = false;
182 const auto result = json::to_cbor(j);
186 CHECK(json::from_cbor(result) == j);
187 CHECK(json::from_cbor(result, true, false) == j);
213 // create JSON value with integer number
214 json j = i;
233 const auto result = json::to_cbor(j);
251 CHECK(json::from_cbor(result) == j);
252 CHECK(json::from_cbor(result, true, false) == j);
270 // create JSON value with integer number
271 json j = i;
286 const auto result = json::to_cbor(j);
300 CHECK(json::from_cbor(result) == j);
301 CHECK(json::from_cbor(result, true, false) == j);
311 // create JSON value with integer number
312 json j = i;
325 const auto result = json::to_cbor(j);
336 CHECK(json::from_cbor(result) == j);
337 CHECK(json::from_cbor(result, true, false) == j);
343 json j = -9263;
346 const auto result = json::to_cbor(j);
353 CHECK(json::from_cbor(result) == j);
354 CHECK(json::from_cbor(result, true, false) == j);
363 // create JSON value with integer number
364 json j = i;
375 const auto result = json::to_cbor(j);
384 CHECK(json::from_cbor(result) == j);
385 CHECK(json::from_cbor(result, true, false) == j);
395 // create JSON value with integer number
396 json j = i;
406 const auto result = json::to_cbor(j);
414 CHECK(json::from_cbor(result) == j);
415 CHECK(json::from_cbor(result, true, false) == j);
425 // create JSON value with integer number
426 json j = -1;
427 … j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
437 const auto result = json::to_cbor(j);
445 CHECK(json::from_cbor(result) == j);
446 CHECK(json::from_cbor(result, true, false) == j);
456 // create JSON value with integer number
457 json j = -1;
458 … j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
469 const auto result = json::to_cbor(j);
478 CHECK(json::from_cbor(result) == j);
479 CHECK(json::from_cbor(result, true, false) == j);
489 // create JSON value with integer number
490 json j = -1;
491 … j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
503 const auto result = json::to_cbor(j);
513 CHECK(json::from_cbor(result) == j);
514 CHECK(json::from_cbor(result, true, false) == j);
527 // create JSON value with integer number
528 json j = -1;
529 … j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
543 const auto result = json::to_cbor(j);
556 CHECK(json::from_cbor(result) == j);
557 CHECK(json::from_cbor(result, true, false) == j);
570 // create JSON value with integer number
571 json j = -1;
572 … j.get_ref<json::number_integer_t&>() = static_cast<json::number_integer_t>(i);
590 const auto result = json::to_cbor(j);
607 CHECK(json::from_cbor(result) == j);
608 CHECK(json::from_cbor(result, true, false) == j);
618 // create JSON value with integer number
619 json j = i;
631 const auto result = json::to_msgpack(j);
641 CHECK(json::from_msgpack(result) == j);
654 // create JSON value with unsigned integer number
655 json j = i;
665 const auto result = json::to_cbor(j);
673 CHECK(json::from_cbor(result) == j);
674 CHECK(json::from_cbor(result, true, false) == j);
684 // create JSON value with unsigned integer number
685 json j = i;
696 const auto result = json::to_cbor(j);
706 CHECK(json::from_cbor(result) == j);
707 CHECK(json::from_cbor(result, true, false) == j);
717 // create JSON value with unsigned integer number
718 json j = i;
730 const auto result = json::to_cbor(j);
740 CHECK(json::from_cbor(result) == j);
741 CHECK(json::from_cbor(result, true, false) == j);
754 // create JSON value with unsigned integer number
755 json j = i;
769 const auto result = json::to_cbor(j);
782 CHECK(json::from_cbor(result) == j);
783 CHECK(json::from_cbor(result, true, false) == j);
796 // create JSON value with integer number
797 json j = i;
815 const auto result = json::to_cbor(j);
832 CHECK(json::from_cbor(result) == j);
833 CHECK(json::from_cbor(result, true, false) == j);
843 json j = v;
848 const auto result = json::to_cbor(j);
852 CHECK(json::from_cbor(result) == j);
853 CHECK(json::from_cbor(result) == v);
855 CHECK(json::from_cbor(result, true, false) == j);
864 json j = v;
869 const auto result = json::to_cbor(j);
872 CHECK(json::from_cbor(result) == j);
873 CHECK(json::from_cbor(result) == v);
878 json j = v;
882 const auto result = json::to_cbor(j);
885 CHECK(json::from_cbor(result) == j);
886 CHECK(json::from_cbor(result) == v);
891 json j = v;
895 const auto result = json::to_cbor(j);
898 CHECK(json::from_cbor(result) == j);
899 CHECK(json::from_cbor(result) == v);
904 json j = v;
908 const auto result = json::to_cbor(j);
911 CHECK(json::from_cbor(result) == j);
912 CHECK(json::from_cbor(result) == v);
917 json j = v;
921 const auto result = json::to_cbor(j);
924 CHECK(json::from_cbor(result) == j);
925 CHECK(json::from_cbor(result) == v);
930 json j = v;
935 const auto result = json::to_cbor(j);
938 CHECK(json::from_cbor(result) == j);
939 CHECK(json::from_cbor(result) == v);
944 json j = v;
949 const auto result = json::to_cbor(j);
952 CHECK(json::from_cbor(result) == j);
953 CHECK(json::from_cbor(result) == v);
958 json j = v;
964 const auto result = json::to_cbor(j);
967 CHECK(json::from_cbor(result) == j);
968 CHECK(json::from_cbor(result) == v);
973 json j = v;
979 const auto result = json::to_cbor(j);
982 CHECK(json::from_cbor(result) == j);
983 CHECK(json::from_cbor(result) == v);
994 json _;
995 … CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0xf9})), json::parse_error&);
996 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0xf9})),
997 …"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: u…
998 … CHECK(json::from_cbor(std::vector<uint8_t>({0xf9}), true, false).is_discarded());
1002 json _;
1003 … CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0xf9, 0x7c})), json::parse_error&);
1004 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0xf9, 0x7c})),
1005 …"[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: u…
1006 … CHECK(json::from_cbor(std::vector<uint8_t>({0xf9, 0x7c}), true, false).is_discarded());
1014 json j = json::from_cbor(std::vector<uint8_t>({0xf9, 0x00, 0x00}));
1015 json::number_float_t d{j};
1021 json j = json::from_cbor(std::vector<uint8_t>({0xf9, 0x80, 0x00}));
1022 json::number_float_t d{j};
1028 json j = json::from_cbor(std::vector<uint8_t>({0xf9, 0x00, 0x01}));
1029 json::number_float_t d{j};
1038 json j = json::from_cbor(std::vector<uint8_t>({0xf9, 0x7c, 0x00}));
1039 json::number_float_t d{j};
1040 CHECK(d == std::numeric_limits<json::number_float_t>::infinity());
1046 json j = json::from_cbor(std::vector<uint8_t>({0xf9, 0xfc, 0x00}));
1047 json::number_float_t d{j};
1048 CHECK(d == -std::numeric_limits<json::number_float_t>::infinity());
1057 json j = json::from_cbor(std::vector<uint8_t>({0xf9, 0x3c, 0x00}));
1058 json::number_float_t d{j};
1064 json j = json::from_cbor(std::vector<uint8_t>({0xf9, 0xc0, 0x00}));
1065 json::number_float_t d{j};
1071 json j = json::from_cbor(std::vector<uint8_t>({0xf9, 0x7b, 0xff}));
1072 json::number_float_t d{j};
1079 json j = json::from_cbor(std::vector<uint8_t>({0xf9, 0x7c, 0x00}));
1080 json::number_float_t d{j};
1087 json j = json::from_cbor(std::vector<uint8_t>({0xf9, 0x7e, 0x00}));
1088 json::number_float_t d{j};
1103 // create JSON value with string containing of N * 'x'
1105 json j = s;
1116 const auto result = json::to_cbor(j);
1126 CHECK(json::from_cbor(result) == j);
1127 CHECK(json::from_cbor(result, true, false) == j);
1137 // create JSON value with string containing of N * 'x'
1139 json j = s;
1151 const auto result = json::to_cbor(j);
1158 CHECK(json::from_cbor(result) == j);
1159 CHECK(json::from_cbor(result, true, false) == j);
1172 // create JSON value with string containing of N * 'x'
1174 json j = s;
1184 const auto result = json::to_cbor(j);
1191 CHECK(json::from_cbor(result) == j);
1192 CHECK(json::from_cbor(result, true, false) == j);
1205 // create JSON value with string containing of N * 'x'
1207 json j = s;
1219 const auto result = json::to_cbor(j);
1226 CHECK(json::from_cbor(result) == j);
1227 CHECK(json::from_cbor(result, true, false) == j);
1236 json j = json::array();
1238 const auto result = json::to_cbor(j);
1242 CHECK(json::from_cbor(result) == j);
1243 CHECK(json::from_cbor(result, true, false) == j);
1248 json j = {nullptr};
1250 const auto result = json::to_cbor(j);
1254 CHECK(json::from_cbor(result) == j);
1255 CHECK(json::from_cbor(result, true, false) == j);
1260 json j = json::parse("[1,2,3,4,5]");
1262 const auto result = json::to_cbor(j);
1266 CHECK(json::from_cbor(result) == j);
1267 CHECK(json::from_cbor(result, true, false) == j);
1272 json j = json::parse("[[[[]]]]");
1274 const auto result = json::to_cbor(j);
1278 CHECK(json::from_cbor(result) == j);
1279 CHECK(json::from_cbor(result, true, false) == j);
1284 json j(257, nullptr);
1289 const auto result = json::to_cbor(j);
1293 CHECK(json::from_cbor(result) == j);
1294 CHECK(json::from_cbor(result, true, false) == j);
1299 json j(65793, nullptr);
1306 const auto result = json::to_cbor(j);
1310 CHECK(json::from_cbor(result) == j);
1311 CHECK(json::from_cbor(result, true, false) == j);
1319 json j = json::object();
1321 const auto result = json::to_cbor(j);
1325 CHECK(json::from_cbor(result) == j);
1326 CHECK(json::from_cbor(result, true, false) == j);
1331 json j = {{"", nullptr}};
1333 const auto result = json::to_cbor(j);
1337 CHECK(json::from_cbor(result) == j);
1338 CHECK(json::from_cbor(result, true, false) == j);
1343 json j = json::parse("{\"a\": {\"b\": {\"c\": {}}}}");
1348 const auto result = json::to_cbor(j);
1352 CHECK(json::from_cbor(result) == j);
1353 CHECK(json::from_cbor(result, true, false) == j);
1358 json j;
1368 const auto result = json::to_cbor(j);
1379 CHECK(json::from_cbor(result) == j);
1380 CHECK(json::from_cbor(result, true, false) == j);
1385 json j;
1395 const auto result = json::to_cbor(j);
1408 CHECK(json::from_cbor(result) == j);
1409 CHECK(json::from_cbor(result, true, false) == j);
1414 json j;
1424 const auto result = json::to_cbor(j);
1439 CHECK(json::from_cbor(result) == j);
1440 CHECK(json::from_cbor(result, true, false) == j);
1452 // create JSON value with byte array containing of N * 'x'
1454 json j = json::binary(s);
1465 const auto result = json::to_cbor(j);
1475 CHECK(json::from_cbor(result) == j);
1476 CHECK(json::from_cbor(result, true, false) == j);
1486 // create JSON value with string containing of N * 'x'
1488 json j = json::binary(s);
1500 const auto result = json::to_cbor(j);
1507 CHECK(json::from_cbor(result) == j);
1508 CHECK(json::from_cbor(result, true, false) == j);
1521 // create JSON value with string containing of N * 'x'
1523 json j = json::binary(s);
1533 const auto result = json::to_cbor(j);
1540 CHECK(json::from_cbor(result) == j);
1541 CHECK(json::from_cbor(result, true, false) == j);
1554 // create JSON value with string containing of N * 'x'
1556 json j = json::binary(s);
1568 const auto result = json::to_cbor(j);
1575 CHECK(json::from_cbor(result) == j);
1576 CHECK(json::from_cbor(result, true, false) == j);
1583 auto j = json::from_cbor(input);
1585 auto k = json::binary({0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff, 0x99});
1586 CAPTURE(j.dump(0, ' ', false, json::error_handler_t::strict))
1594 CHECK_NOTHROW(json::from_cbor(input));
1601 CHECK_NOTHROW(json::from_cbor(input));
1611 … auto callback = [&binary_seen](int /*depth*/, json::parse_event_t /*event*/, json & parsed)
1620 json j;
1621 auto cbp = nlohmann::detail::json_sax_dom_callback_parser<json>(j, callback, true);
1622 CHECK(json::sax_parse(input, &cbp, json::input_format_t::cbor));
1636 json j = json::from_cbor(given);
1637 CHECK(j == json::binary(std::vector<uint8_t> {'a'}));
1645 json j = json::from_cbor(given);
1654 json j = json::from_cbor(given);
1655 CHECK(j == json::parse("[false]"));
1663 json j = json::from_cbor(given);
1664 CHECK(j == json::parse("{\"\": false}"));
1672 json _;
1673 CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>()), json::parse_error&);
1674 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>()),
1675 …"[json.exception.parse_error.110] parse error at byte 1: syntax error while parsing CBOR value: un…
1676 CHECK(json::from_cbor(std::vector<uint8_t>(), true, false).is_discarded());
1681 json _;
1682 CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x18})), json::parse_error&);
1683 CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x19})), json::parse_error&);
1684 … CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x19, 0x00})), json::parse_error&);
1685 CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1a})), json::parse_error&);
1686 … CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1a, 0x00})), json::parse_error&);
1687 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1a, 0x00, 0x00})), json::parse_error&);
1688 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1a, 0x00, 0x00, 0x00})), json::parse_e…
1689 CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b})), json::parse_error&);
1690 … CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00})), json::parse_error&);
1691 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00})), json::parse_error&);
1692 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00})), json::parse_e…
1693 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00})), json::p…
1694 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00})), j…
1695 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00…
1696 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00…
1697 CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x62})), json::parse_error&);
1698 … CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x62, 0x60})), json::parse_error&);
1699 CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x7F})), json::parse_error&);
1700 … CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x7F, 0x60})), json::parse_error&);
1701 … CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x82, 0x01})), json::parse_error&);
1702 … CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x9F, 0x01})), json::parse_error&);
1703 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0x61, 0xF5})), json::parse_e…
1704 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0xA1, 0x61, 0X61})), json::parse_error&);
1705 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0X61})), json::parse_error&);
1706 CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x5F})), json::parse_error&);
1707 … CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x5F, 0x00})), json::parse_error&);
1708 CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x41})), json::parse_error&);
1710 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x18})),
1711 …"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: u…
1712 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x19})),
1713 …"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: u…
1714 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x19, 0x00})),
1715 …"[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: u…
1716 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1a})),
1717 …"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: u…
1718 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1a, 0x00})),
1719 …"[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: u…
1720 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1a, 0x00, 0x00})),
1721 …"[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR number: u…
1722 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1a, 0x00, 0x00, 0x00})),
1723 …"[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing CBOR number: u…
1724 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1b})),
1725 …"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR number: u…
1726 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00})),
1727 …"[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR number: u…
1728 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00})),
1729 …"[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR number: u…
1730 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00})),
1731 …"[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing CBOR number: u…
1732 … CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00})),
1733 …"[json.exception.parse_error.110] parse error at byte 6: syntax error while parsing CBOR number: u…
1734 … CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00})),
1735 …"[json.exception.parse_error.110] parse error at byte 7: syntax error while parsing CBOR number: u…
1736 …CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x…
1737 …"[json.exception.parse_error.110] parse error at byte 8: syntax error while parsing CBOR number: u…
1738 …CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x…
1739 …"[json.exception.parse_error.110] parse error at byte 9: syntax error while parsing CBOR number: u…
1740 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x62})),
1741 …"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR string: u…
1742 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x62, 0x60})),
1743 …"[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR string: u…
1744 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x7F})),
1745 …"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR string: u…
1746 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x7F, 0x60})),
1747 …"[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR string: u…
1748 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x82, 0x01})),
1749 …"[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR value: un…
1750 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x9F, 0x01})),
1751 …"[json.exception.parse_error.110] parse error at byte 3: syntax error while parsing CBOR value: un…
1752 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0x61, 0xF5})),
1753 …"[json.exception.parse_error.110] parse error at byte 5: syntax error while parsing CBOR string: u…
1754 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0xA1, 0x61, 0x61})),
1755 …"[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR value: un…
1756 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0x61})),
1757 …"[json.exception.parse_error.110] parse error at byte 4: syntax error while parsing CBOR value: un…
1758 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x5F})),
1759 …"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR binary: u…
1760 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x5F, 0x00})),
1761 …"[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing CBOR binary: e…
1762 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x41})),
1763 …"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR binary: u…
1765 CHECK(json::from_cbor(std::vector<uint8_t>({0x18}), true, false).is_discarded());
1766 CHECK(json::from_cbor(std::vector<uint8_t>({0x19}), true, false).is_discarded());
1767 CHECK(json::from_cbor(std::vector<uint8_t>({0x19, 0x00}), true, false).is_discarded());
1768 CHECK(json::from_cbor(std::vector<uint8_t>({0x1a}), true, false).is_discarded());
1769 CHECK(json::from_cbor(std::vector<uint8_t>({0x1a, 0x00}), true, false).is_discarded());
1770 … CHECK(json::from_cbor(std::vector<uint8_t>({0x1a, 0x00, 0x00}), true, false).is_discarded());
1771 …CHECK(json::from_cbor(std::vector<uint8_t>({0x1a, 0x00, 0x00, 0x00}), true, false).is_discarded());
1772 CHECK(json::from_cbor(std::vector<uint8_t>({0x1b}), true, false).is_discarded());
1773 CHECK(json::from_cbor(std::vector<uint8_t>({0x1b, 0x00}), true, false).is_discarded());
1774 … CHECK(json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00}), true, false).is_discarded());
1775 …CHECK(json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00}), true, false).is_discarded());
1776 …CHECK(json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00}), true, false).is_discar…
1777 …CHECK(json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00}), true, false).is_…
1778 …CHECK(json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}), true, fals…
1779 …CHECK(json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}), true…
1780 CHECK(json::from_cbor(std::vector<uint8_t>({0x62}), true, false).is_discarded());
1781 CHECK(json::from_cbor(std::vector<uint8_t>({0x62, 0x60}), true, false).is_discarded());
1782 CHECK(json::from_cbor(std::vector<uint8_t>({0x7F}), true, false).is_discarded());
1783 CHECK(json::from_cbor(std::vector<uint8_t>({0x7F, 0x60}), true, false).is_discarded());
1784 CHECK(json::from_cbor(std::vector<uint8_t>({0x82, 0x01}), true, false).is_discarded());
1785 CHECK(json::from_cbor(std::vector<uint8_t>({0x9F, 0x01}), true, false).is_discarded());
1786 …CHECK(json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0x61, 0xF5}), true, false).is_discarded());
1787 … CHECK(json::from_cbor(std::vector<uint8_t>({0xA1, 0x61, 0x61}), true, false).is_discarded());
1788 … CHECK(json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0x61}), true, false).is_discarded());
1789 CHECK(json::from_cbor(std::vector<uint8_t>({0x5F}), true, false).is_discarded());
1790 CHECK(json::from_cbor(std::vector<uint8_t>({0x5F, 0x00}), true, false).is_discarded());
1791 CHECK(json::from_cbor(std::vector<uint8_t>({0x41}), true, false).is_discarded());
1798 json _;
1799 … CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0x1c})), json::parse_error&);
1800 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0x1c})),
1801 …"[json.exception.parse_error.112] parse error at byte 1: syntax error while parsing CBOR value: in…
1802 CHECK(json::from_cbor(std::vector<uint8_t>({0x1c}), true, false).is_discarded());
1804 … CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0xf8})), json::parse_error&);
1805 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0xf8})),
1806 …"[json.exception.parse_error.112] parse error at byte 1: syntax error while parsing CBOR value: in…
1807 CHECK(json::from_cbor(std::vector<uint8_t>({0xf8}), true, false).is_discarded());
1850 json _;
1851 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({static_cast<uint8_t>(byte)})), json::par…
1852 …CHECK(json::from_cbor(std::vector<uint8_t>({static_cast<uint8_t>(byte)}), true, false).is_discarde…
1859 json _;
1860 …CHECK_THROWS_AS(_ = json::from_cbor(std::vector<uint8_t>({0xa1, 0xff, 0x01})), json::parse_error&);
1861 CHECK_THROWS_WITH(_ = json::from_cbor(std::vector<uint8_t>({0xa1, 0xff, 0x01})),
1862 …"[json.exception.parse_error.113] parse error at byte 2: syntax error while parsing CBOR string: e…
1863 … CHECK(json::from_cbor(std::vector<uint8_t>({0xa1, 0xff, 0x01}), true, false).is_discarded());
1871 const auto result = json::from_cbor(vec, false);
1872 CHECK(result == json());
1873 CHECK(!json::from_cbor(vec, false, false).is_discarded());
1878 json _;
1879 CHECK_THROWS_AS(_ = json::from_cbor(vec), json::parse_error&);
1880 CHECK_THROWS_WITH(_ = json::from_cbor(vec),
1881 …"[json.exception.parse_error.110] parse error at byte 2: syntax error while parsing CBOR value: ex…
1882 CHECK(json::from_cbor(vec, true, false).is_discarded());
1893 CHECK(!json::sax_parse(v, &scp, json::input_format_t::cbor));
1900 CHECK(!json::sax_parse(v, &scp, json::input_format_t::cbor));
1907 CHECK(!json::sax_parse(v, &scp, json::input_format_t::cbor));
1915 SECTION("sample.json")
1917 std::string filename = TEST_DATA_DIRECTORY "/json_testsuite/sample.json";
1919 // parse JSON file
1921 json j1 = json::parse(f_json);
1925 json j2;
1926 CHECK_NOTHROW(j2 = json::from_cbor(packed));
1928 // compare parsed JSON values
1936 json::to_cbor(j1, ss);
1937 json j3 = json::from_cbor(ss.str());
1944 json::to_cbor(j1, s);
1945 json j3 = json::from_cbor(s);
1952 CHECK(j1 == json::from_cbor(packed.begin() + 5, packed.end()));
1997 json j1 = json::from_cbor(vec1); in CAPTURE()
2002 std::vector<uint8_t> vec2 = json::to_cbor(j1); in CAPTURE()
2005 json j2 = json::from_cbor(vec2); in CAPTURE()
2010 catch (const json::parse_error&) in CAPTURE()
2016 catch (const json::parse_error&)
2032 TEST_DATA_DIRECTORY "/json.org/1.json", in skip()
2033 TEST_DATA_DIRECTORY "/json.org/2.json", in skip()
2034 TEST_DATA_DIRECTORY "/json.org/3.json", in skip()
2035 TEST_DATA_DIRECTORY "/json.org/4.json", in skip()
2036 TEST_DATA_DIRECTORY "/json.org/5.json", in skip()
2037 TEST_DATA_DIRECTORY "/json_testsuite/sample.json", // kills AppVeyor in skip()
2038 TEST_DATA_DIRECTORY "/json_tests/pass1.json", in skip()
2039 TEST_DATA_DIRECTORY "/regression/working_file.json", in skip()
2040 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object.json", in skip()
2041 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_duplicated_key.json", in skip()
2042 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_long_strings.json", in skip()
2047 TEST_DATA_DIRECTORY "/json_nlohmann_tests/all_unicode.json", in skip()
2048 TEST_DATA_DIRECTORY "/json.org/1.json", in skip()
2049 TEST_DATA_DIRECTORY "/json.org/2.json", in skip()
2050 TEST_DATA_DIRECTORY "/json.org/3.json", in skip()
2051 TEST_DATA_DIRECTORY "/json.org/4.json", in skip()
2052 TEST_DATA_DIRECTORY "/json.org/5.json", in skip()
2053 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip01.json", in skip()
2054 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip02.json", in skip()
2055 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip03.json", in skip()
2056 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip04.json", in skip()
2057 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip05.json", in skip()
2058 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip06.json", in skip()
2059 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip07.json", in skip()
2060 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip08.json", in skip()
2061 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip09.json", in skip()
2062 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip10.json", in skip()
2063 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip11.json", in skip()
2064 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip12.json", in skip()
2065 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip13.json", in skip()
2066 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip14.json", in skip()
2067 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip15.json", in skip()
2068 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip16.json", in skip()
2069 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip17.json", in skip()
2070 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip18.json", in skip()
2071 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip19.json", in skip()
2072 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip20.json", in skip()
2073 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip21.json", in skip()
2074 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip22.json", in skip()
2075 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip23.json", in skip()
2076 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip24.json", in skip()
2077 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip25.json", in skip()
2078 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip26.json", in skip()
2079 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip27.json", in skip()
2080 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip28.json", in skip()
2081 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip29.json", in skip()
2082 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip30.json", in skip()
2083 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip31.json", in skip()
2084 TEST_DATA_DIRECTORY "/json_roundtrip/roundtrip32.json", in skip()
2085 TEST_DATA_DIRECTORY "/json_testsuite/sample.json", // kills AppVeyor in skip()
2086 TEST_DATA_DIRECTORY "/json_tests/pass1.json", in skip()
2087 TEST_DATA_DIRECTORY "/json_tests/pass2.json", in skip()
2088 TEST_DATA_DIRECTORY "/json_tests/pass3.json", in skip()
2089 TEST_DATA_DIRECTORY "/regression/floats.json", in skip()
2090 TEST_DATA_DIRECTORY "/regression/signed_ints.json", in skip()
2091 TEST_DATA_DIRECTORY "/regression/unsigned_ints.json", in skip()
2092 TEST_DATA_DIRECTORY "/regression/working_file.json", in skip()
2093 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_array_arraysWithSpaces.json", in skip()
2094 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_array_empty-string.json", in skip()
2095 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_array_empty.json", in skip()
2096 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_array_ending_with_newline.json", in skip()
2097 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_array_false.json", in skip()
2098 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_array_heterogeneous.json", in skip()
2099 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_array_null.json", in skip()
2100 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_array_with_1_and_newline.json", in skip()
2101 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_array_with_leading_space.json", in skip()
2102 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_array_with_several_null.json", in skip()
2103 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_array_with_trailing_space.json", in skip()
2104 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number.json", in skip()
2105 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_0e+1.json", in skip()
2106 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_0e1.json", in skip()
2107 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_after_space.json", in skip()
2108 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_double_close_to_zero.json", in skip()
2109 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_double_huge_neg_exp.json", in skip()
2110 //TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_huge_exp.json", in skip()
2111 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_int_with_exp.json", in skip()
2112 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_minus_zero.json", in skip()
2113 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_negative_int.json", in skip()
2114 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_negative_one.json", in skip()
2115 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_negative_zero.json", in skip()
2116 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_real_capital_e.json", in skip()
2117 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_real_capital_e_neg_exp.json", in skip()
2118 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_real_capital_e_pos_exp.json", in skip()
2119 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_real_exponent.json", in skip()
2120 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_real_fraction_exponent.json", in skip()
2121 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_real_neg_exp.json", in skip()
2122 … //TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_real_neg_overflow.json", in skip()
2123 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_real_pos_exponent.json", in skip()
2124 … //TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_real_pos_overflow.json", in skip()
2125 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_real_underflow.json", in skip()
2126 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_simple_int.json", in skip()
2127 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_simple_real.json", in skip()
2128 … //TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_too_big_neg_int.json", in skip()
2129 … //TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_too_big_pos_int.json", in skip()
2130 … //TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_number_very_big_negative_int.json", in skip()
2131 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object.json", in skip()
2132 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_basic.json", in skip()
2133 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_duplicated_key.json", in skip()
2134 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_duplicated_key_and_value.json", in skip()
2135 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_empty.json", in skip()
2136 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_empty_key.json", in skip()
2137 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_escaped_null_in_key.json", in skip()
2138 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_extreme_numbers.json", in skip()
2139 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_long_strings.json", in skip()
2140 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_simple.json", in skip()
2141 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_string_unicode.json", in skip()
2142 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_object_with_newlines.json", in skip()
2143 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_1_2_3_bytes_UTF-8_sequences.json", in skip()
2144 …Y "/nst_json_testsuite/test_parsing/y_string_UTF-16_Surrogates_U+1D11E_MUSICAL_SYMBOL_G_CLEF.json", in skip()
2145 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_accepted_surrogate_pair.json", in skip()
2146 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_accepted_surrogate_pairs.json", in skip()
2147 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_allowed_escapes.json", in skip()
2148 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_backslash_and_u_escaped_zero.json", in skip()
2149 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_backslash_doublequotes.json", in skip()
2150 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_comments.json", in skip()
2151 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_double_escape_a.json", in skip()
2152 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_double_escape_n.json", in skip()
2153 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_escaped_control_character.json", in skip()
2154 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_escaped_noncharacter.json", in skip()
2155 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_in_array.json", in skip()
2156 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_in_array_with_leading_space.json", in skip()
2157 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_last_surrogates_1_and_2.json", in skip()
2158 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_newline_uescaped.json", in skip()
2159 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_nonCharacterInUTF-8_U+10FFFF.json", in skip()
2160 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_nonCharacterInUTF-8_U+1FFFF.json", in skip()
2161 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_nonCharacterInUTF-8_U+FFFF.json", in skip()
2162 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_null_escape.json", in skip()
2163 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_one-byte-utf-8.json", in skip()
2164 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_pi.json", in skip()
2165 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_simple_ascii.json", in skip()
2166 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_space.json", in skip()
2167 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_three-byte-utf-8.json", in skip()
2168 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_two-byte-utf-8.json", in skip()
2169 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_u+2028_line_sep.json", in skip()
2170 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_u+2029_par_sep.json", in skip()
2171 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_uEscape.json", in skip()
2172 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_unescaped_char_delete.json", in skip()
2173 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_unicode.json", in skip()
2174 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_unicodeEscapedBackslash.json", in skip()
2175 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_unicode_2.json", in skip()
2176 …ST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_unicode_U+200B_ZERO_WIDTH_SPACE.json", in skip()
2177 …TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_unicode_U+2064_invisible_plus.json", in skip()
2178 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_unicode_escaped_double_quote.json", in skip()
2179 // TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_utf16.json", in skip()
2180 TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_utf8.json", in skip()
2181 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_string_with_del_character.json", in skip()
2182 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_structure_lonely_false.json", in skip()
2183 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_structure_lonely_int.json", in skip()
2184 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_structure_lonely_negative_real.json", in skip()
2185 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_structure_lonely_null.json", in skip()
2186 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_structure_lonely_string.json", in skip()
2187 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_structure_lonely_true.json", in skip()
2188 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_structure_string_empty.json", in skip()
2189 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_structure_trailing_newline.json", in skip()
2190 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_structure_true_in_array.json", in skip()
2191 … TEST_DATA_DIRECTORY "/nst_json_testsuite/test_parsing/y_structure_whitespace_array.json" in skip()
2198 // parse JSON file in skip()
2200 json j1 = json::parse(f_json); in skip()
2204 json j2; in skip()
2205 CHECK_NOTHROW(j2 = json::from_cbor(packed)); in skip()
2207 // compare parsed JSON values in skip()
2213 // parse JSON file in skip()
2215 json j1 = json::parse(f_json); in skip()
2219 json j2; in skip()
2220 CHECK_NOTHROW(j2 = json::from_cbor(f_cbor)); in skip()
2222 // compare parsed JSON values in skip()
2228 // parse JSON file in skip()
2230 json j1 = json::parse(f_json); in skip()
2234 json j2; in skip()
2235 CHECK_NOTHROW(j2 = json::from_cbor({packed.data(), packed.size()})); in skip()
2237 // compare parsed JSON values in skip()
2243 // parse JSON file in skip()
2245 json j1 = json::parse(f_json); in skip()
2255 json::to_cbor(j1, vec); in skip()
2317 auto res = json::from_cbor(std::vector<uint8_t>(1, byte));
2319 catch (const json::parse_error& e)
2341 CHECK(json::to_cbor(json::parse("0")) == std::vector<uint8_t>({0x00}));
2342 CHECK(json::parse("0") == json::from_cbor(std::vector<uint8_t>({0x00})));
2344 CHECK(json::to_cbor(json::parse("1")) == std::vector<uint8_t>({0x01}));
2345 CHECK(json::parse("1") == json::from_cbor(std::vector<uint8_t>({0x01})));
2347 CHECK(json::to_cbor(json::parse("10")) == std::vector<uint8_t>({0x0a}));
2348 CHECK(json::parse("10") == json::from_cbor(std::vector<uint8_t>({0x0a})));
2350 CHECK(json::to_cbor(json::parse("23")) == std::vector<uint8_t>({0x17}));
2351 CHECK(json::parse("23") == json::from_cbor(std::vector<uint8_t>({0x17})));
2353 CHECK(json::to_cbor(json::parse("24")) == std::vector<uint8_t>({0x18, 0x18}));
2354 CHECK(json::parse("24") == json::from_cbor(std::vector<uint8_t>({0x18, 0x18})));
2356 CHECK(json::to_cbor(json::parse("25")) == std::vector<uint8_t>({0x18, 0x19}));
2357 CHECK(json::parse("25") == json::from_cbor(std::vector<uint8_t>({0x18, 0x19})));
2359 CHECK(json::to_cbor(json::parse("100")) == std::vector<uint8_t>({0x18, 0x64}));
2360 CHECK(json::parse("100") == json::from_cbor(std::vector<uint8_t>({0x18, 0x64})));
2362 CHECK(json::to_cbor(json::parse("1000")) == std::vector<uint8_t>({0x19, 0x03, 0xe8}));
2363 CHECK(json::parse("1000") == json::from_cbor(std::vector<uint8_t>({0x19, 0x03, 0xe8})));
2365 …CHECK(json::to_cbor(json::parse("1000000")) == std::vector<uint8_t>({0x1a, 0x00, 0x0f, 0x42, 0x40}…
2366 …CHECK(json::parse("1000000") == json::from_cbor(std::vector<uint8_t>({0x1a, 0x00, 0x0f, 0x42, 0x40…
2368 …CHECK(json::to_cbor(json::parse("1000000000000")) == std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00,…
2369 …CHECK(json::parse("1000000000000") == json::from_cbor(std::vector<uint8_t>({0x1b, 0x00, 0x00, 0x00…
2371 …CHECK(json::to_cbor(json::parse("18446744073709551615")) == std::vector<uint8_t>({0x1b, 0xff, 0xff…
2372 …CHECK(json::parse("18446744073709551615") == json::from_cbor(std::vector<uint8_t>({0x1b, 0xff, 0xf…
2375 …//CHECK(json::to_cbor(json::parse("18446744073709551616")) == std::vector<uint8_t>({0xc2, 0x49, 0x…
2376 …//CHECK(json::parse("18446744073709551616") == json::from_cbor(std::vector<uint8_t>({0xc2, 0x49, 0…
2378 …//CHECK(json::to_cbor(json::parse("-18446744073709551616")) == std::vector<uint8_t>({0x3b, 0xff, 0…
2379 …//CHECK(json::parse("-18446744073709551616") == json::from_cbor(std::vector<uint8_t>({0x3b, 0xff, …
2382 …//CHECK(json::to_cbor(json::parse("-18446744073709551617")) == std::vector<uint8_t>({0xc3, 0x49, 0…
2383 …//CHECK(json::parse("-18446744073709551617") == json::from_cbor(std::vector<uint8_t>({0xc3, 0x49, …
2385 CHECK(json::to_cbor(json::parse("-1")) == std::vector<uint8_t>({0x20}));
2386 CHECK(json::parse("-1") == json::from_cbor(std::vector<uint8_t>({0x20})));
2388 CHECK(json::to_cbor(json::parse("-10")) == std::vector<uint8_t>({0x29}));
2389 CHECK(json::parse("-10") == json::from_cbor(std::vector<uint8_t>({0x29})));
2391 CHECK(json::to_cbor(json::parse("-100")) == std::vector<uint8_t>({0x38, 0x63}));
2392 CHECK(json::parse("-100") == json::from_cbor(std::vector<uint8_t>({0x38, 0x63})));
2394 CHECK(json::to_cbor(json::parse("-1000")) == std::vector<uint8_t>({0x39, 0x03, 0xe7}));
2395 CHECK(json::parse("-1000") == json::from_cbor(std::vector<uint8_t>({0x39, 0x03, 0xe7})));
2398 //CHECK(json::to_cbor(json::parse("0.0")) == std::vector<uint8_t>({0xf9, 0x00, 0x00}));
2399 CHECK(json::parse("0.0") == json::from_cbor(std::vector<uint8_t>({0xf9, 0x00, 0x00})));
2402 //CHECK(json::to_cbor(json::parse("-0.0")) == std::vector<uint8_t>({0xf9, 0x80, 0x00}));
2403 CHECK(json::parse("-0.0") == json::from_cbor(std::vector<uint8_t>({0xf9, 0x80, 0x00})));
2406 //CHECK(json::to_cbor(json::parse("1.0")) == std::vector<uint8_t>({0xf9, 0x3c, 0x00}));
2407 CHECK(json::parse("1.0") == json::from_cbor(std::vector<uint8_t>({0xf9, 0x3c, 0x00})));
2409 …CHECK(json::to_cbor(json::parse("1.1")) == std::vector<uint8_t>({0xfb, 0x3f, 0xf1, 0x99, 0x99, 0x9…
2410 …CHECK(json::parse("1.1") == json::from_cbor(std::vector<uint8_t>({0xfb, 0x3f, 0xf1, 0x99, 0x99, 0x…
2413 //CHECK(json::to_cbor(json::parse("1.5")) == std::vector<uint8_t>({0xf9, 0x3e, 0x00}));
2414 CHECK(json::parse("1.5") == json::from_cbor(std::vector<uint8_t>({0xf9, 0x3e, 0x00})));
2417 //CHECK(json::to_cbor(json::parse("65504.0")) == std::vector<uint8_t>({0xf9, 0x7b, 0xff}));
2418 CHECK(json::parse("65504.0") == json::from_cbor(std::vector<uint8_t>({0xf9, 0x7b, 0xff})));
2420 …//CHECK(json::to_cbor(json::parse("100000.0")) == std::vector<uint8_t>({0xfa, 0x47, 0xc3, 0x50, 0x…
2421 …CHECK(json::parse("100000.0") == json::from_cbor(std::vector<uint8_t>({0xfa, 0x47, 0xc3, 0x50, 0x0…
2423 …//CHECK(json::to_cbor(json::parse("3.4028234663852886e+38")) == std::vector<uint8_t>({0xfa, 0x7f, …
2424 …CHECK(json::parse("3.4028234663852886e+38") == json::from_cbor(std::vector<uint8_t>({0xfa, 0x7f, 0…
2426 …CHECK(json::to_cbor(json::parse("1.0e+300")) == std::vector<uint8_t>({0xfb, 0x7e, 0x37, 0xe4, 0x3c…
2427 …CHECK(json::parse("1.0e+300") == json::from_cbor(std::vector<uint8_t>({0xfb, 0x7e, 0x37, 0xe4, 0x3…
2430 …//CHECK(json::to_cbor(json::parse("5.960464477539063e-8")) == std::vector<uint8_t>({0xf9, 0x00, 0x…
2431 CHECK(json::parse("-4.0") == json::from_cbor(std::vector<uint8_t>({0xf9, 0xc4, 0x00})));
2434 …//CHECK(json::to_cbor(json::parse("0.00006103515625")) == std::vector<uint8_t>({0xf9, 0x04, 0x00})…
2435 CHECK(json::parse("-4.0") == json::from_cbor(std::vector<uint8_t>({0xf9, 0xc4, 0x00})));
2438 //CHECK(json::to_cbor(json::parse("-4.0")) == std::vector<uint8_t>({0xf9, 0xc4, 0x00}));
2439 CHECK(json::parse("-4.0") == json::from_cbor(std::vector<uint8_t>({0xf9, 0xc4, 0x00})));
2441 …CHECK(json::to_cbor(json::parse("-4.1")) == std::vector<uint8_t>({0xfb, 0xc0, 0x10, 0x66, 0x66, 0x…
2442 …CHECK(json::parse("-4.1") == json::from_cbor(std::vector<uint8_t>({0xfb, 0xc0, 0x10, 0x66, 0x66, 0…
2447 CHECK(json::to_cbor(json::parse("false")) == std::vector<uint8_t>({0xf4}));
2448 CHECK(json::parse("false") == json::from_cbor(std::vector<uint8_t>({0xf4})));
2450 CHECK(json::to_cbor(json::parse("true")) == std::vector<uint8_t>({0xf5}));
2451 CHECK(json::parse("true") == json::from_cbor(std::vector<uint8_t>({0xf5})));
2453 CHECK(json::to_cbor(json::parse("true")) == std::vector<uint8_t>({0xf5}));
2454 CHECK(json::parse("true") == json::from_cbor(std::vector<uint8_t>({0xf5})));
2459 CHECK(json::to_cbor(json::parse("\"\"")) == std::vector<uint8_t>({0x60}));
2460 CHECK(json::parse("\"\"") == json::from_cbor(std::vector<uint8_t>({0x60})));
2462 CHECK(json::to_cbor(json::parse("\"a\"")) == std::vector<uint8_t>({0x61, 0x61}));
2463 CHECK(json::parse("\"a\"") == json::from_cbor(std::vector<uint8_t>({0x61, 0x61})));
2465 …CHECK(json::to_cbor(json::parse("\"IETF\"")) == std::vector<uint8_t>({0x64, 0x49, 0x45, 0x54, 0x46…
2466 …CHECK(json::parse("\"IETF\"") == json::from_cbor(std::vector<uint8_t>({0x64, 0x49, 0x45, 0x54, 0x4…
2468 … CHECK(json::to_cbor(json::parse("\"\\u00fc\"")) == std::vector<uint8_t>({0x62, 0xc3, 0xbc}));
2469 … CHECK(json::parse("\"\\u00fc\"") == json::from_cbor(std::vector<uint8_t>({0x62, 0xc3, 0xbc})));
2471 …CHECK(json::to_cbor(json::parse("\"\\u6c34\"")) == std::vector<uint8_t>({0x63, 0xe6, 0xb0, 0xb4}));
2472 …CHECK(json::parse("\"\\u6c34\"") == json::from_cbor(std::vector<uint8_t>({0x63, 0xe6, 0xb0, 0xb4})…
2474 …CHECK(json::to_cbor(json::parse("\"\\ud800\\udd51\"")) == std::vector<uint8_t>({0x64, 0xf0, 0x90, …
2475 …CHECK(json::parse("\"\\ud800\\udd51\"") == json::from_cbor(std::vector<uint8_t>({0x64, 0xf0, 0x90,…
2478 …CHECK(json::parse("\"streaming\"") == json::from_cbor(std::vector<uint8_t>({0x7f, 0x65, 0x73, 0x74…
2484 json j;
2485 CHECK_NOTHROW(j = json::from_cbor(packed));
2488 CHECK(j == json::binary(expected));
2490 …CHECK(json::to_cbor(json::binary(std::vector<uint8_t> {}, 0x42)) == std::vector<uint8_t> {0xd8, 0x…
2495 CHECK(json::to_cbor(json::parse("[]")) == std::vector<uint8_t>({0x80}));
2496 CHECK(json::parse("[]") == json::from_cbor(std::vector<uint8_t>({0x80})));
2498 … CHECK(json::to_cbor(json::parse("[1, 2, 3]")) == std::vector<uint8_t>({0x83, 0x01, 0x02, 0x03}));
2499 …CHECK(json::parse("[1, 2, 3]") == json::from_cbor(std::vector<uint8_t>({0x83, 0x01, 0x02, 0x03})));
2501 …CHECK(json::to_cbor(json::parse("[1, [2, 3], [4, 5]]")) == std::vector<uint8_t>({0x83, 0x01, 0x82,…
2502 …CHECK(json::parse("[1, [2, 3], [4, 5]]") == json::from_cbor(std::vector<uint8_t>({0x83, 0x01, 0x82…
2504 …CHECK(json::to_cbor(json::parse("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 1…
2505 …CHECK(json::parse("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,…
2508 CHECK(json::parse("[]") == json::from_cbor(std::vector<uint8_t>({0x9f, 0xff})));
2509 …CHECK(json::parse("[1, [2, 3], [4, 5]] ") == json::from_cbor(std::vector<uint8_t>({0x9f, 0x01, 0x8…
2510 …CHECK(json::parse("[1, [2, 3], [4, 5]]") == json::from_cbor(std::vector<uint8_t>({0x9f, 0x01, 0x82…
2511 …CHECK(json::parse("[1, [2, 3], [4, 5]]") == json::from_cbor(std::vector<uint8_t>({0x83, 0x01, 0x82…
2512 …CHECK(json::parse("[1, [2, 3], [4, 5]]") == json::from_cbor(std::vector<uint8_t>({0x83, 0x01, 0x9f…
2513 …CHECK(json::parse("[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,…
2518 CHECK(json::to_cbor(json::parse("{}")) == std::vector<uint8_t>({0xa0}));
2519 CHECK(json::parse("{}") == json::from_cbor(std::vector<uint8_t>({0xa0})));
2521 …CHECK(json::to_cbor(json::parse("{\"a\": 1, \"b\": [2, 3]}")) == std::vector<uint8_t>({0xa2, 0x61,…
2522 …CHECK(json::parse("{\"a\": 1, \"b\": [2, 3]}") == json::from_cbor(std::vector<uint8_t>({0xa2, 0x61…
2524 …CHECK(json::to_cbor(json::parse("[\"a\", {\"b\": \"c\"}]")) == std::vector<uint8_t>({0x82, 0x61, 0…
2525 …CHECK(json::parse("[\"a\", {\"b\": \"c\"}]") == json::from_cbor(std::vector<uint8_t>({0x82, 0x61, …
2527 …CHECK(json::to_cbor(json::parse("{\"a\": \"A\", \"b\": \"B\", \"c\": \"C\", \"d\": \"D\", \"e\": \…
2528 …CHECK(json::parse("{\"a\": \"A\", \"b\": \"B\", \"c\": \"C\", \"d\": \"D\", \"e\": \"E\"}") == jso…
2531 …CHECK(json::parse("{\"a\": 1, \"b\": [2, 3]}") == json::from_cbor(std::vector<uint8_t>({0xbf, 0x61…
2532 …CHECK(json::parse("[\"a\", {\"b\": \"c\"}]") == json::from_cbor(std::vector<uint8_t>({0x82, 0x61, …
2533 …CHECK(json::parse("{\"Fun\": true, \"Amt\": -2}") == json::from_cbor(std::vector<uint8_t>({0xbf, 0…
2539 json j = "s";
2540 auto v = json::to_cbor(j);
2554 CHECK_THROWS_AS(json::from_cbor(v_tagged), json::parse_error);
2555 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::error), json::pars…
2558 auto j_tagged = json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::ignore);
2573 CHECK_THROWS_AS(json::from_cbor(v_tagged), json::parse_error);
2574 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::error), json::pars…
2577 auto j_tagged = json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::ignore);
2588 CHECK_THROWS_AS(json::from_cbor(v_tagged), json::parse_error);
2589 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::error), json::pars…
2590 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::ignore), json::par…
2605 CHECK_THROWS_AS(json::from_cbor(v_tagged), json::parse_error);
2606 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::error), json::pars…
2609 auto j_tagged = json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::ignore);
2621 CHECK_THROWS_AS(json::from_cbor(v_tagged), json::parse_error);
2622 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::error), json::pars…
2623 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::ignore), json::par…
2640 CHECK_THROWS_AS(json::from_cbor(v_tagged), json::parse_error);
2641 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::error), json::pars…
2644 auto j_tagged = json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::ignore);
2658 CHECK_THROWS_AS(json::from_cbor(v_tagged), json::parse_error);
2659 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::error), json::pars…
2660 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::ignore), json::par…
2681 CHECK_THROWS_AS(json::from_cbor(v_tagged), json::parse_error);
2682 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::error), json::pars…
2685 auto j_tagged = json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::ignore);
2703 CHECK_THROWS_AS(json::from_cbor(v_tagged), json::parse_error);
2704 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::error), json::pars…
2705 …CHECK_THROWS_AS(json::from_cbor(v_tagged, true, true, json::cbor_tag_handler_t::ignore), json::par…
2712 json j_binary;
2713 j_binary["binary"] = json::binary({0xCA, 0xFE, 0xBA, 0xBE}, 42);
2716 const auto vec = json::to_cbor(j_binary);
2720 CHECK_THROWS_AS(json::from_cbor(vec), json::parse_error);
2721 …CHECK_THROWS_WITH(json::from_cbor(vec), "[json.exception.parse_error.112] parse error at byte 9: s…
2724 json jb = json::from_cbor(vec, true, true, json::cbor_tag_handler_t::ignore);