Implement hex specifier

This commit is contained in:
Victor Zverovich
2024-01-01 08:39:12 -08:00
parent 1705600be3
commit e1aac42663
2 changed files with 63 additions and 19 deletions
+6
View File
@@ -59,6 +59,12 @@ TEST(scan_test, read_ulonglong) {
"invalid input");
}
TEST(scan_test, read_hex) {
unsigned n = 0;
fmt::scan("2a", "{:x}", n);
EXPECT_EQ(n, 42);
}
TEST(scan_test, read_string) {
std::string s;
fmt::scan("foo", "{}", s);