mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-02 15:11:43 +01:00
Add dynamic width support to FMT_COMPILE (#1809)
This commit is contained in:
@@ -153,6 +153,11 @@ TEST(CompileTest, FormatSpecs) {
|
||||
EXPECT_EQ("42", fmt::format(FMT_COMPILE("{:x}"), 0x42));
|
||||
}
|
||||
|
||||
TEST(CompileTest, DynamicWidth) {
|
||||
EXPECT_EQ(" 42foo ",
|
||||
fmt::format(FMT_COMPILE("{:{}}{:{}}"), 42, 4, "foo", 5));
|
||||
}
|
||||
|
||||
TEST(CompileTest, FormatTo) {
|
||||
char buf[8];
|
||||
auto end = fmt::format_to(buf, FMT_COMPILE("{}"), 42);
|
||||
|
||||
Reference in New Issue
Block a user