mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-02 23:21:45 +01:00
Add variable-width fill support (#1109)
This commit is contained in:
@@ -815,6 +815,7 @@ TEST(FormatterTest, Fill) {
|
||||
EXPECT_EQ("**0xface", format("{0:*>8}", reinterpret_cast<void*>(0xface)));
|
||||
EXPECT_EQ("foo=", format("{:}=", "foo"));
|
||||
EXPECT_EQ(std::string("\0\0\0*", 4), format(string_view("{:\0>4}", 6), '*'));
|
||||
EXPECT_EQ("жж42", format("{0:ж>4}", 42));
|
||||
}
|
||||
|
||||
TEST(FormatterTest, PlusSign) {
|
||||
@@ -2173,7 +2174,7 @@ struct test_format_specs_handler {
|
||||
type(other.type) {}
|
||||
|
||||
FMT_CONSTEXPR void on_align(fmt::align_t a) { align = a; }
|
||||
FMT_CONSTEXPR void on_fill(char f) { fill = f; }
|
||||
FMT_CONSTEXPR void on_fill(fmt::string_view f) { fill = f[0]; }
|
||||
FMT_CONSTEXPR void on_plus() { res = PLUS; }
|
||||
FMT_CONSTEXPR void on_minus() { res = MINUS; }
|
||||
FMT_CONSTEXPR void on_space() { res = SPACE; }
|
||||
|
||||
Reference in New Issue
Block a user