🔨 added user-defined exception 406

This commit is contained in:
Niels Lohmann 2017-03-12 20:59:33 +01:00
parent 43b8285249
commit c5cf32e34d
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
5 changed files with 11 additions and 7 deletions

View file

@ -277,8 +277,9 @@ TEST_CASE("parser class")
SECTION("overflow")
{
// overflows during parsing yield an exception
CHECK_THROWS_AS(json::parser("1.18973e+4932").parse() == json(), std::out_of_range);
CHECK_THROWS_WITH(json::parser("1.18973e+4932").parse() == json(), "number overflow: 1.18973e+4932");
CHECK_THROWS_AS(json::parser("1.18973e+4932").parse() == json(), json::out_of_range);
CHECK_THROWS_WITH(json::parser("1.18973e+4932").parse() == json(),
"[json.exception.out_of_range.406] number overflow parsing '1.18973e+4932'");
}
SECTION("invalid numbers")