mirror of
https://github.com/fmtlib/fmt.git
synced 2025-10-18 16:55:27 +02:00
Add support for negative width.
This commit is contained in:
@@ -221,6 +221,7 @@ TEST(PrintfTest, Width) {
|
||||
|
||||
TEST(PrintfTest, DynamicWidth) {
|
||||
EXPECT_EQ(" 42", str(fmt::sprintf("%*d", 5, 42)));
|
||||
EXPECT_EQ("42 ", str(fmt::sprintf("%*d", -5, 42)));
|
||||
EXPECT_THROW_MSG(fmt::sprintf("%*d", 5.0, 42), FormatError,
|
||||
"width is not integer");
|
||||
EXPECT_THROW_MSG(fmt::sprintf("%*d"), FormatError,
|
||||
|
Reference in New Issue
Block a user