mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-11 15:00:06 +00:00
Move nan test to where it belongs
This commit is contained in:
parent
68555fdbd2
commit
51f2e2ca27
@ -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];
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user