Skip to content

Commit

Permalink
Add regression test for dumping the minimum value of int64_t
Browse files Browse the repository at this point in the history
  • Loading branch information
t-b committed Aug 26, 2019
1 parent a015b78 commit e170761
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/src/unit-regression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1802,6 +1802,13 @@ TEST_CASE("regression tests")
json j = json::parse("[-9223372036854775808]");
CHECK(j.dump() == "[-9223372036854775808]");
}

SECTION("issue #1708 - minimum value of int64_t can be outputted")
{
auto smallest = (std::numeric_limits<int64_t>::min)();
json j = smallest;
CHECK(j.dump() == std::to_string(smallest));
}
}

#if not defined(JSON_NOEXCEPTION)
Expand Down

0 comments on commit e170761

Please sign in to comment.