Compute output size for grisu

This commit is contained in:
Victor Zverovich
2018-10-18 17:16:50 -07:00
parent b71d3fe7ab
commit 13d472bd8c
2 changed files with 152 additions and 106 deletions
+4
View File
@@ -1415,6 +1415,10 @@ TEST(FormatterTest, FormatDouble) {
EXPECT_EQ(buffer, format("{:A}", -42.0));
}
TEST(FormatterTest, FormatDoubleBigPrecision) {
EXPECT_EQ(format("0.{:0<1000}", ""), format("{:.1000f}", 0.0));
}
TEST(FormatterTest, FormatNaN) {
double nan = std::numeric_limits<double>::quiet_NaN();
EXPECT_EQ("nan", format("{}", nan));