mirror of
https://github.com/nlohmann/json.git
synced 2026-02-21 03:32:27 +00:00
🚧 implement more parent relations
This commit is contained in:
@@ -271,13 +271,16 @@ TEST_CASE("iterators 2")
|
||||
{
|
||||
CHECK_THROWS_AS(j.begin() == k.begin(), json::invalid_iterator&);
|
||||
CHECK_THROWS_AS(j.cbegin() == k.cbegin(), json::invalid_iterator&);
|
||||
CHECK_THROWS_WITH(j.begin() == k.begin(), "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
|
||||
CHECK_THROWS_WITH(j.cbegin() == k.cbegin(), "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
|
||||
|
||||
CHECK_THROWS_AS(j.begin() < k.begin(), json::invalid_iterator&);
|
||||
CHECK_THROWS_AS(j.cbegin() < k.cbegin(), json::invalid_iterator&);
|
||||
#if JSON_DIAGNOSTICS
|
||||
// the output differs in each loop, so we cannot fix a string for the expected exception
|
||||
#else
|
||||
CHECK_THROWS_WITH(j.begin() == k.begin(), "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
|
||||
CHECK_THROWS_WITH(j.cbegin() == k.cbegin(), "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
|
||||
CHECK_THROWS_WITH(j.begin() < k.begin(), "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
|
||||
CHECK_THROWS_WITH(j.cbegin() < k.cbegin(), "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -750,13 +753,16 @@ TEST_CASE("iterators 2")
|
||||
{
|
||||
CHECK_THROWS_AS(j.rbegin() == k.rbegin(), json::invalid_iterator&);
|
||||
CHECK_THROWS_AS(j.crbegin() == k.crbegin(), json::invalid_iterator&);
|
||||
CHECK_THROWS_WITH(j.rbegin() == k.rbegin(), "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
|
||||
CHECK_THROWS_WITH(j.crbegin() == k.crbegin(), "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
|
||||
|
||||
CHECK_THROWS_AS(j.rbegin() < k.rbegin(), json::invalid_iterator&);
|
||||
CHECK_THROWS_AS(j.crbegin() < k.crbegin(), json::invalid_iterator&);
|
||||
#if JSON_DIAGNOSTICS
|
||||
// the output differs in each loop, so we cannot fix a string for the expected exception
|
||||
#else
|
||||
CHECK_THROWS_WITH(j.rbegin() == k.rbegin(), "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
|
||||
CHECK_THROWS_WITH(j.crbegin() == k.crbegin(), "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
|
||||
CHECK_THROWS_WITH(j.rbegin() < k.rbegin(), "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
|
||||
CHECK_THROWS_WITH(j.crbegin() < k.crbegin(), "[json.exception.invalid_iterator.212] cannot compare iterators of different containers");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,7 +343,11 @@ TEST_CASE("JSON patch")
|
||||
|
||||
// check that evaluation throws
|
||||
CHECK_THROWS_AS(doc.patch(patch), json::other_error&);
|
||||
#if JSON_DIAGNOSTICS
|
||||
CHECK_THROWS_WITH_STD_STR(doc.patch(patch), "[json.exception.other_error.501] (/0) unsuccessful: " + patch[0].dump());
|
||||
#else
|
||||
CHECK_THROWS_WITH_STD_STR(doc.patch(patch), "[json.exception.other_error.501] unsuccessful: " + patch[0].dump());
|
||||
#endif
|
||||
}
|
||||
|
||||
SECTION("A.10. Adding a Nested Member Object")
|
||||
@@ -484,7 +488,11 @@ TEST_CASE("JSON patch")
|
||||
|
||||
// check that evaluation throws
|
||||
CHECK_THROWS_AS(doc.patch(patch), json::other_error&);
|
||||
#if JSON_DIAGNOSTICS
|
||||
CHECK_THROWS_WITH_STD_STR(doc.patch(patch), "[json.exception.other_error.501] (/0) unsuccessful: " + patch[0].dump());
|
||||
#else
|
||||
CHECK_THROWS_WITH_STD_STR(doc.patch(patch), "[json.exception.other_error.501] unsuccessful: " + patch[0].dump());
|
||||
#endif
|
||||
}
|
||||
|
||||
SECTION("A.16. Adding an Array Value")
|
||||
@@ -1183,7 +1191,11 @@ TEST_CASE("JSON patch")
|
||||
|
||||
// the test will fail
|
||||
CHECK_THROWS_AS(doc.patch(patch), json::other_error&);
|
||||
#if JSON_DIAGNOSTICS
|
||||
CHECK_THROWS_WITH_STD_STR(doc.patch(patch), "[json.exception.other_error.501] (/0) unsuccessful: " + patch[0].dump());
|
||||
#else
|
||||
CHECK_THROWS_WITH_STD_STR(doc.patch(patch), "[json.exception.other_error.501] unsuccessful: " + patch[0].dump());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1268,7 +1280,7 @@ TEST_CASE("JSON patch")
|
||||
std::ifstream f(filename);
|
||||
json suite = json::parse(f);
|
||||
|
||||
for (const auto& test : suite)
|
||||
for (const auto test : suite)
|
||||
{
|
||||
INFO_WITH_TEMP(test.value("comment", ""));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user