1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-25 13:41:56 +03:00

improved test coverage

As we guarantee proper UTF-8 before, we do not need to cope with it later.
This commit is contained in:
Niels Lohmann
2017-12-12 20:44:57 +01:00
parent 569d275f65
commit 8419bfbbd2
3 changed files with 7 additions and 15 deletions

View File

@ -101,10 +101,10 @@ TEST_CASE("convenience functions")
// invalid UTF-8 characters
CHECK_THROWS_AS(check_escaped("ä\xA9ü"), json::type_error);
CHECK_THROWS_WITH(check_escaped("ä\xA9ü"),
"[json.exception.type_error.316] invalid UTF-8 byte at index 2: 0xA9");
"[json.exception.type_error.316] invalid UTF-8 byte at index 2: 0xA9");
CHECK_THROWS_AS(check_escaped("\xC2"), json::type_error);
CHECK_THROWS_WITH(check_escaped("\xC2"),
"[json.exception.type_error.316] incomplete UTF-8 string; last byte: 0xC2");
"[json.exception.type_error.316] incomplete UTF-8 string; last byte: 0xC2");
}
}