mirror of
https://github.com/nlohmann/json.git
synced 2025-07-25 13:41:56 +03:00
🔨 more work on the number parser
This commit is contained in:
@ -270,6 +270,11 @@ TEST_CASE("parser class")
|
||||
}
|
||||
}
|
||||
|
||||
SECTION("overflow")
|
||||
{
|
||||
CHECK(json::parser("1.18973e+4932").parse() == json());
|
||||
}
|
||||
|
||||
SECTION("invalid numbers")
|
||||
{
|
||||
CHECK_THROWS_AS(json::parser("01").parse(), std::invalid_argument);
|
||||
@ -294,7 +299,7 @@ TEST_CASE("parser class")
|
||||
CHECK_THROWS_AS(json::parser("+0").parse(), std::invalid_argument);
|
||||
|
||||
CHECK_THROWS_WITH(json::parser("01").parse(),
|
||||
"parse error - unexpected number literal; expected end of input");
|
||||
"parse error - unexpected number literal");
|
||||
CHECK_THROWS_WITH(json::parser("--1").parse(), "parse error - unexpected '-'");
|
||||
CHECK_THROWS_WITH(json::parser("1.").parse(),
|
||||
"parse error - unexpected '.'; expected end of input");
|
||||
|
Reference in New Issue
Block a user