summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/FormatVariadicTest.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-06-15 03:06:38 +0000
committerZachary Turner <zturner@google.com>2017-06-15 03:06:38 +0000
commit6b3517ce1bd6dfb68ef7123e7495bb598a336d25 (patch)
tree0084302d9223b468d9eabb74c05f47e25002955f /llvm/unittests/Support/FormatVariadicTest.cpp
parent968eea2c1130ae34526fc0fd44df4996270a858f (diff)
downloadbcm5719-llvm-6b3517ce1bd6dfb68ef7123e7495bb598a336d25.tar.gz
bcm5719-llvm-6b3517ce1bd6dfb68ef7123e7495bb598a336d25.zip
[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. llvm-svn: 305449
Diffstat (limited to 'llvm/unittests/Support/FormatVariadicTest.cpp')
-rw-r--r--llvm/unittests/Support/FormatVariadicTest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/unittests/Support/FormatVariadicTest.cpp b/llvm/unittests/Support/FormatVariadicTest.cpp
index 99b90b17ae4..5387a8ae499 100644
--- a/llvm/unittests/Support/FormatVariadicTest.cpp
+++ b/llvm/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());
OpenPOWER on IntegriCloud