improved test coverage

This commit is contained in:
Niels Lohmann 2017-09-09 11:04:58 +02:00
parent 5c08b84dec
commit fd250ae2b1
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
2 changed files with 34 additions and 0 deletions

View file

@ -323,6 +323,8 @@ TEST_CASE("deserialization")
{
uint8_t v[] = {'\"', 0x7F, 0xDF, 0x7F};
CHECK_THROWS_AS(json::parse(std::begin(v), std::end(v)), json::parse_error&);
CHECK_THROWS_WITH(json::parse(std::begin(v), std::end(v)),
"[json.exception.parse_error.101] parse error at 4: syntax error - invalid string: ill-formed UTF-8 byte; last read: '\"\x7f\xdf\x7f'");
CHECK(not json::accept(std::begin(v), std::end(v)));
json j_error;