diff options
author | Zachary Turner <zturner@google.com> | 2017-06-15 03:06:38 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-06-15 03:06:38 +0000 |
commit | ba503556ac20f40b3dee239ce6f8cad9dea7e614 (patch) | |
tree | cd168bbe3457aef7f3ab3da88ee4a6779f9945de /unittests | |
parent | 46d1553fcdfc753ce095eb6067b5659efdb8d855 (diff) |
[formatv] Add the ability to specify a fill character when aligning.
Previously if you used fmt_align(7, Center) you would get the
output ' 7 '. It may be desirable for the user to specify
the fill character though, for example producing '---7---'. This
patch adds that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305449 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Support/FormatVariadicTest.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/unittests/Support/FormatVariadicTest.cpp b/unittests/Support/FormatVariadicTest.cpp index 99b90b17ae44..5387a8ae499c 100644 --- a/unittests/Support/FormatVariadicTest.cpp +++ b/unittests/Support/FormatVariadicTest.cpp @@ -542,6 +542,8 @@ TEST(FormatVariadicTest, Adapter) { EXPECT_EQ(" 171 ", formatv("{0}", fmt_align(N, AlignStyle::Center, 7)).str()); + EXPECT_EQ("--171--", + formatv("{0}", fmt_align(N, AlignStyle::Center, 7, '-')).str()); EXPECT_EQ(" 171 ", formatv("{0}", fmt_pad(N, 1, 3)).str()); EXPECT_EQ("171171171171171", formatv("{0}", fmt_repeat(N, 5)).str()); |