added user-defined exceptions 404-405

This commit is contained in:
Niels Lohmann 2017-03-05 23:25:22 +01:00
parent 30331fa21f
commit 38c2e20ce8
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
4 changed files with 35 additions and 28 deletions

View file

@ -791,8 +791,9 @@ TEST_CASE("JSON patch")
{
json j = "string";
json patch = {{{"op", "remove"}, {"path", ""}}};
CHECK_THROWS_AS(j.patch(patch), std::domain_error);
CHECK_THROWS_WITH(j.patch(patch), "JSON pointer has no parent");
CHECK_THROWS_AS(j.patch(patch), json::out_of_range);
CHECK_THROWS_WITH(j.patch(patch),
"[json.exception.out_of_range.405] JSON pointer has no parent");
}
}