✅ improve coverage
This commit is contained in:
parent
5ec0980514
commit
33379684b4
@ -58,14 +58,14 @@ class diagnostics_t
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default: // LCOV_EXCL_LINE
|
||||||
break;
|
break; // LCOV_EXCL_LINE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tokens.empty())
|
if (tokens.empty())
|
||||||
{
|
{
|
||||||
return "";
|
return ""; // LCOV_EXCL_LINE
|
||||||
}
|
}
|
||||||
|
|
||||||
return "(" + std::accumulate(tokens.rbegin(), tokens.rend(), std::string{},
|
return "(" + std::accumulate(tokens.rbegin(), tokens.rend(), std::string{},
|
||||||
|
|||||||
@ -2556,14 +2556,14 @@ class diagnostics_t
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default: // LCOV_EXCL_LINE
|
||||||
break;
|
break; // LCOV_EXCL_LINE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tokens.empty())
|
if (tokens.empty())
|
||||||
{
|
{
|
||||||
return "";
|
return ""; // LCOV_EXCL_LINE
|
||||||
}
|
}
|
||||||
|
|
||||||
return "(" + std::accumulate(tokens.rbegin(), tokens.rend(), std::string{},
|
return "(" + std::accumulate(tokens.rbegin(), tokens.rend(), std::string{},
|
||||||
|
|||||||
@ -40,6 +40,13 @@ using nlohmann::json;
|
|||||||
|
|
||||||
TEST_CASE("Better diagnostics")
|
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")
|
SECTION("invalid type")
|
||||||
{
|
{
|
||||||
json j;
|
json j;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user