1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-29 23:01:16 +03:00
This commit is contained in:
Niels
2015-05-06 19:52:12 +02:00
parent 1580eee4ed
commit 17609f244d
4 changed files with 55 additions and 5 deletions

View File

@ -8450,4 +8450,25 @@ TEST_CASE("regression tests")
CHECK(j == R"(["\"foo\""])"_json);
}
}
SECTION("issue #70 - Handle infinity and NaN cases")
{
SECTION("NAN value")
{
CHECK(json(NAN) == json());
}
SECTION("overflows")
{
CHECK(json(std::exp(800)) == json());
CHECK(json(HUGE_VALF) == json());
CHECK(json(HUGE_VAL) == json());
CHECK(json(HUGE_VALL) == json());
}
SECTION("infinity")
{
CHECK(json(INFINITY) == json());
}
}
}