mirror of
https://github.com/nlohmann/json.git
synced 2026-02-28 06:16:24 +00:00
✅ more tests
This commit is contained in:
@@ -1295,7 +1295,8 @@ TEST_CASE("CBOR")
|
||||
CHECK_THROWS_AS(json::from_cbor(std::vector<uint8_t>({0x82, 0x01})), json::parse_error&);
|
||||
CHECK_THROWS_AS(json::from_cbor(std::vector<uint8_t>({0x9F, 0x01})), json::parse_error&);
|
||||
CHECK_THROWS_AS(json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0x61, 0xF5})), json::parse_error&);
|
||||
|
||||
CHECK_THROWS_AS(json::from_cbor(std::vector<uint8_t>({0xA1, 0x61, 0X61})), json::parse_error&);
|
||||
CHECK_THROWS_AS(json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0X61})), json::parse_error&);
|
||||
|
||||
CHECK_THROWS_WITH(json::from_cbor(std::vector<uint8_t>({0x18})),
|
||||
"[json.exception.parse_error.110] parse error at 2: unexpected end of input");
|
||||
@@ -1341,6 +1342,10 @@ TEST_CASE("CBOR")
|
||||
"[json.exception.parse_error.110] parse error at 3: unexpected end of input");
|
||||
CHECK_THROWS_WITH(json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0x61, 0xF5})),
|
||||
"[json.exception.parse_error.110] parse error at 5: unexpected end of input");
|
||||
CHECK_THROWS_WITH(json::from_cbor(std::vector<uint8_t>({0xA1, 0x61, 0x61})),
|
||||
"[json.exception.parse_error.110] parse error at 4: unexpected end of input");
|
||||
CHECK_THROWS_WITH(json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0x61})),
|
||||
"[json.exception.parse_error.110] parse error at 4: unexpected end of input");
|
||||
|
||||
CHECK(json::from_cbor(std::vector<uint8_t>({0x18}), true, false).is_discarded());
|
||||
CHECK(json::from_cbor(std::vector<uint8_t>({0x19}), true, false).is_discarded());
|
||||
@@ -1364,6 +1369,8 @@ TEST_CASE("CBOR")
|
||||
CHECK(json::from_cbor(std::vector<uint8_t>({0x82, 0x01}), true, false).is_discarded());
|
||||
CHECK(json::from_cbor(std::vector<uint8_t>({0x9F, 0x01}), true, false).is_discarded());
|
||||
CHECK(json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0x61, 0xF5}), true, false).is_discarded());
|
||||
CHECK(json::from_cbor(std::vector<uint8_t>({0xA1, 0x61, 0x61}), true, false).is_discarded());
|
||||
CHECK(json::from_cbor(std::vector<uint8_t>({0xBF, 0x61, 0x61}), true, false).is_discarded());
|
||||
}
|
||||
|
||||
SECTION("unsupported bytes")
|
||||
|
||||
Reference in New Issue
Block a user