More showpoint fixes and tests (#1498)

This commit is contained in:
Victor Zverovich committed 2019-12-30 13:08:35 -10:00
1 parent 455a7c0787
commit c85efef312
3 files changed
+8 -3

No files matched your search

+3
View File
@@ -926,6 +926,9 @@ TEST(FormatterTest, HashFlag) {
EXPECT_EQ("-42.0", format("{0:#}", -42.0));
EXPECT_EQ("-42.0", format("{0:#}", -42.0l));
EXPECT_EQ("4.e+01", format("{:#.0e}", 42.0));
EXPECT_EQ("0.", format("{:#.0f}", 0.01));
auto s = format("{:#.0f}", 0.5); // MSVC's printf uses wrong rounding mode.
EXPECT_TRUE(s == "0." || s == "1.");
EXPECT_THROW_MSG(format("{0:#", 'c'), format_error,
"missing '}' in format string");
EXPECT_THROW_MSG(format("{0:#}", 'c'), format_error,