Implement empty format specs

This commit is contained in:
Victor Zverovich
2024-01-01 07:40:05 -08:00
parent c068c7c622
commit d33731d202
2 changed files with 89 additions and 101 deletions

View File

@@ -29,6 +29,8 @@ TEST(scan_test, read_int) {
EXPECT_EQ(n, 42);
fmt::scan("-42", "{}", n);
EXPECT_EQ(n, -42);
fmt::scan("42", "{:}", n);
EXPECT_EQ(n, 42);
EXPECT_THROW_MSG(fmt::scan(std::to_string(INT_MAX + 1u), "{}", n),
fmt::format_error, "number is too big");
}