Test full exponent range

This commit is contained in:
Victor Zverovich 2024-08-18 06:47:04 -07:00
parent 94b8bc8eae
commit 62382e3650

View File

@ -930,6 +930,11 @@ TEST(format_test, runtime_width) {
EXPECT_EQ(fmt::format("{:{}}", 42, short(4)), " 42");
}
TEST(format_test, exponent_range) {
for (int e = -1074; e <= 1023; ++e)
(void)fmt::format("{}", std::ldexp(1, e));
}
TEST(format_test, precision) {
char format_str[buffer_size];
safe_sprintf(format_str, "{0:.%u", UINT_MAX);