🔨 added user-defined exceptions 205-206

This commit is contained in:
Niels Lohmann 2017-03-03 14:00:42 +01:00
parent 875b2da95d
commit a4274d7766
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
6 changed files with 102 additions and 98 deletions

View file

@ -1106,13 +1106,15 @@ TEST_CASE("constructors")
{
{
json j;
CHECK_THROWS_AS(json(j.begin(), j.end()), std::domain_error);
CHECK_THROWS_WITH(json(j.begin(), j.end()), "cannot use construct with iterators from null");
CHECK_THROWS_AS(json(j.begin(), j.end()), json::invalid_iterator);
CHECK_THROWS_WITH(json(j.begin(), j.end()),
"[json.exception.invalid_iterator.206] cannot construct with iterators from null");
}
{
json j;
CHECK_THROWS_AS(json(j.cbegin(), j.cend()), std::domain_error);
CHECK_THROWS_WITH(json(j.cbegin(), j.cend()), "cannot use construct with iterators from null");
CHECK_THROWS_AS(json(j.cbegin(), j.cend()), json::invalid_iterator);
CHECK_THROWS_WITH(json(j.cbegin(), j.cend()),
"[json.exception.invalid_iterator.206] cannot construct with iterators from null");
}
}