mirror of
https://github.com/nlohmann/json.git
synced 2025-07-29 23:01:16 +03:00
fixed #70
This commit is contained in:
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user