mirror of
https://github.com/nlohmann/json.git
synced 2026-02-09 23:52:15 +00:00
🔀 merge branch 'develop' into feature/exceptions_3.0.0
This commit is contained in:
@@ -702,11 +702,17 @@ TEST_CASE("constructors")
|
||||
|
||||
SECTION("infinity")
|
||||
{
|
||||
// infinity is stored as null
|
||||
// should change in the future: https://github.com/nlohmann/json/issues/388
|
||||
// infinity is stored properly, but serialized to null
|
||||
json::number_float_t n(std::numeric_limits<json::number_float_t>::infinity());
|
||||
json j(n);
|
||||
CHECK(j.type() == json::value_t::null);
|
||||
CHECK(j.type() == json::value_t::number_float);
|
||||
|
||||
// check round trip of infinity
|
||||
json::number_float_t d = j;
|
||||
CHECK(d == n);
|
||||
|
||||
// check that inf is serialized to null
|
||||
CHECK(j.dump() == "null");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user