Move nan test to where it belongs

This commit is contained in:
Victor Zverovich 2020-09-27 12:50:18 -07:00
parent 68555fdbd2
commit 51f2e2ca27
2 changed files with 4 additions and 8 deletions

View File

@ -312,14 +312,6 @@ TEST(FormatTest, ArgConverter) {
EXPECT_EQ(value, fmt::visit_format_arg(value_extractor<long long>(), arg));
}
TEST(FormatTest, FormatNegativeNaN) {
double nan = std::numeric_limits<double>::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];

View File

@ -1306,6 +1306,10 @@ TEST(FormatterTest, FormatNaN) {
double nan = std::numeric_limits<double>::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));