From ba503556ac20f40b3dee239ce6f8cad9dea7e614 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Thu, 15 Jun 2017 03:06:38 +0000 Subject: [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 --- unittests/Support/FormatVariadicTest.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'unittests') 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()); -- cgit v1.2.3