Skip to content

Commit

Permalink
✅ added a regression test for #380 / #390
Browse files Browse the repository at this point in the history
  • Loading branch information
nlohmann committed Dec 13, 2016
1 parent 4e2fb1a commit 2f94c30
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ I deeply appreciate the help of the following people.
- [TurpentineDistillery](https://github.com/TurpentineDistillery) pointed to [`std::locale::classic()`](http://en.cppreference.com/w/cpp/locale/locale/classic) to avoid too much locale joggling, found some nice performance improvements in the parser and improved the benchmarking code.
- [cgzones](https://github.com/cgzones) had an idea how to fix the Coverity scan.
- [Jared Grubb](https://github.com/jaredgrubb) silenced a nasty documentation warning.
- [Yixin Zhang](https://github.com/qwename) fixed an integer overflow check.
Thanks a lot for helping out!
Expand Down
7 changes: 7 additions & 0 deletions test/src/unit-regression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,4 +533,11 @@ TEST_CASE("regression tests")
json j3 = json::parse("-9223372036854775809");
CHECK(j3.is_number_float());
}

SECTION("issue #380 - bug in overflow detection when parsing integers")
{
json j = json::parse("166020696663385964490");
CHECK(j.is_number_float());
CHECK(j.dump() == "1.66020696663386e+20");
}
}

0 comments on commit 2f94c30

Please sign in to comment.