diff --git a/test/format-impl-test.cc b/test/format-impl-test.cc index dbb635bc..d77842da 100644 --- a/test/format-impl-test.cc +++ b/test/format-impl-test.cc @@ -312,14 +312,6 @@ TEST(FormatTest, ArgConverter) { EXPECT_EQ(value, fmt::visit_format_arg(value_extractor(), arg)); } -TEST(FormatTest, FormatNegativeNaN) { - double nan = std::numeric_limits::quiet_NaN(); - if (std::signbit(-nan)) - EXPECT_EQ("-nan", fmt::format("{}", -nan)); - else - fmt::print("Warning: compiler doesn't handle negative NaN correctly"); -} - TEST(FormatTest, StrError) { char* message = nullptr; char buffer[BUFFER_SIZE]; diff --git a/test/format-test.cc b/test/format-test.cc index 21c93a83..8cf54182 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1306,6 +1306,10 @@ TEST(FormatterTest, FormatNaN) { double nan = std::numeric_limits::quiet_NaN(); EXPECT_EQ("nan", format("{}", nan)); EXPECT_EQ("+nan", format("{:+}", nan)); + if (std::signbit(-nan)) + EXPECT_EQ("-nan", format("{}", -nan)); + else + fmt::print("Warning: compiler doesn't handle negative NaN correctly"); EXPECT_EQ(" nan", format("{: }", nan)); EXPECT_EQ("NAN", format("{:F}", nan)); EXPECT_EQ("nan ", format("{:<7}", nan));