Add regression test for dumping the minimum value of int64_t
This commit is contained in:
parent
6ce2f35ba8
commit
70aa8a31a2
1 changed files with 7 additions and 0 deletions
|
@ -1802,6 +1802,13 @@ TEST_CASE("regression tests")
|
||||||
json j = json::parse("[-9223372036854775808]");
|
json j = json::parse("[-9223372036854775808]");
|
||||||
CHECK(j.dump() == "[-9223372036854775808]");
|
CHECK(j.dump() == "[-9223372036854775808]");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SECTION("issue #1708 - minimum value of int64_t can be outputted")
|
||||||
|
{
|
||||||
|
constexpr auto smallest = (std::numeric_limits<int64_t>::min)();
|
||||||
|
json j = smallest;
|
||||||
|
CHECK(j.dump() == std::to_string(smallest));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if not defined(JSON_NOEXCEPTION)
|
#if not defined(JSON_NOEXCEPTION)
|
||||||
|
|
Loading…
Reference in a new issue