Merge branch 'develop' of https://github.com/nlohmann/json into issue2592

This commit is contained in:
Niels Lohmann
2021-07-15 22:28:03 +02:00
190 changed files with 6436 additions and 14044 deletions

View File

@@ -504,8 +504,11 @@ TEST_CASE("JSON pointers")
// error for nonprimitve values
CHECK_THROWS_AS(json({{"/1", {1, 2, 3}}}).unflatten(), json::type_error&);
CHECK_THROWS_WITH(json({{"/1", {1, 2, 3}}}).unflatten(),
"[json.exception.type_error.315] values in object must be primitive");
#if JSON_DIAGNOSTICS
CHECK_THROWS_WITH(json({{"/1", {1, 2, 3}}}).unflatten(), "[json.exception.type_error.315] (/~11) values in object must be primitive");
#else
CHECK_THROWS_WITH(json({{"/1", {1, 2, 3}}}).unflatten(), "[json.exception.type_error.315] values in object must be primitive");
#endif
// error for conflicting values
json j_error = {{"", 42}, {"/foo", 17}};
@@ -535,7 +538,7 @@ TEST_CASE("JSON pointers")
SECTION("string representation")
{
for (auto ptr :
for (const auto* ptr :
{"", "/foo", "/foo/0", "/", "/a~1b", "/c%d", "/e^f", "/g|h", "/i\\j", "/k\"l", "/ ", "/m~0n"
})
{