From 846c644e848ca1a11c679b168cfc690bc3c89c61 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 19 Oct 2018 07:30:59 -0700 Subject: [PATCH] Workeround broken sprintf in MSVC --- test/format-test.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/format-test.cc b/test/format-test.cc index 2515685b..2f227bf0 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1416,7 +1416,9 @@ TEST(FormatterTest, FormatDouble) { } TEST(FormatterTest, FormatDoubleBigPrecision) { - EXPECT_EQ(format("0.{:0<1000}", ""), format("{:.1000f}", 0.0)); + // sprintf with big precision is broken in MSVC2013, so only test on Grisu. + if (FMT_USE_GRISU) + EXPECT_EQ(format("0.{:0<1000}", ""), format("{:.1000f}", 0.0)); } TEST(FormatterTest, FormatNaN) {