1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-21 04:22:05 +03:00

🔨 added user-defined exceptions 2xx

This commit is contained in:
Niels Lohmann
2017-03-03 14:34:57 +01:00
parent a4274d7766
commit 0c40c8e3be
9 changed files with 306 additions and 304 deletions

View File

@ -616,14 +616,15 @@ TEST_CASE("modifiers")
{
json j_other_array2 = {"first", "second"};
CHECK_THROWS_AS(j_array.insert(j_array.end(), j_array.begin(), j_array.end()), std::domain_error);
CHECK_THROWS_AS(j_array.insert(j_array.end(), j_array.begin(), j_array.end()),
json::invalid_iterator);
CHECK_THROWS_AS(j_array.insert(j_array.end(), j_other_array.begin(), j_other_array2.end()),
std::domain_error);
json::invalid_iterator);
CHECK_THROWS_WITH(j_array.insert(j_array.end(), j_array.begin(), j_array.end()),
"passed iterators may not belong to container");
"[json.exception.invalid_iterator.211] passed iterators may not belong to container");
CHECK_THROWS_WITH(j_array.insert(j_array.end(), j_other_array.begin(), j_other_array2.end()),
"iterators do not fit");
"[json.exception.invalid_iterator.210] iterators do not fit");
}
}