improve coverage

This commit is contained in:
Niels Lohmann
2021-01-17 22:52:40 +01:00
parent 5ec0980514
commit 33379684b4
3 changed files with 13 additions and 6 deletions

View File

@@ -40,6 +40,13 @@ using nlohmann::json;
TEST_CASE("Better diagnostics")
{
SECTION("empty JSON Pointer")
{
json j = 1;
std::string s;
CHECK_THROWS_WITH_AS(s = j.get<std::string>(), "[json.exception.type_error.302] type must be string, but is number", json::type_error);
}
SECTION("invalid type")
{
json j;