Add support for negative width.

This commit is contained in:
Victor Zverovich
2014-06-23 08:10:50 -07:00
parent 91e6bc8b97
commit 4099a1269b
2 changed files with 31 additions and 5 deletions

View File

@@ -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,