diff options
author | Victor Zverovich <victor.zverovich@gmail.com> | 2019-11-25 14:57:11 -0800 |
---|---|---|
committer | Victor Zverovich <victor.zverovich@gmail.com> | 2019-11-25 15:54:04 -0800 |
commit | d19ed6716d7101474e87939fe1c29b1f9d46ffd7 (patch) | |
tree | a37c0e7d3e0f0e489194e45aa40e50587f47e692 /test | |
parent | 99b6e928d402379a7cda9a435649ee17261d866d (diff) | |
download | fmtlib-d19ed6716d7101474e87939fe1c29b1f9d46ffd7.tar.gz |
Fix hexfloat buffer reallocation
Diffstat (limited to 'test')
-rw-r--r-- | test/format-test.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/format-test.cc b/test/format-test.cc index bce5539f..e747a407 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1212,6 +1212,20 @@ TEST(FormatterTest, Precision) { "012970999954193198940908041656332452475714786901472678015935523861155013" "480352649347201937902681071074917033322268447533357208324319361e-324", format("{:.494}", 4.9406564584124654E-324)); + EXPECT_EQ( + "-0X1.41FE3FFE71C9E000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000000000000000000000000" + "000000000000000000000000000000000000000000000000000P+127", + format("{:.838A}", -2.14001164E+38)); EXPECT_EQ("123.", format("{:#.0f}", 123.0)); EXPECT_THROW_MSG(format("{0:.2}", reinterpret_cast<void*>(0xcafe)), |