added missing tests

This commit is contained in:
Niels Lohmann 2017-02-26 11:50:52 +01:00
parent f1cd15ce7e
commit d1b30250d6
No known key found for this signature in database
GPG key ID: 7F3CEA63AE251B69
3 changed files with 17 additions and 1 deletions

View file

@ -699,6 +699,15 @@ TEST_CASE("constructors")
json j(n);
CHECK(j.type() == json::value_t::number_float);
}
SECTION("infinity")
{
// infinity is stored as null
// should change in the future: https://github.com/nlohmann/json/issues/388
json::number_float_t n(std::numeric_limits<json::number_float_t>::infinity());
json j(n);
CHECK(j.type() == json::value_t::null);
}
}
SECTION("create a floating-point number (implicit)")