diff options
Diffstat (limited to 'gnu/llvm/unittests/Support/FormatVariadicTest.cpp')
| -rw-r--r-- | gnu/llvm/unittests/Support/FormatVariadicTest.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gnu/llvm/unittests/Support/FormatVariadicTest.cpp b/gnu/llvm/unittests/Support/FormatVariadicTest.cpp index 9307c6d8e09..5387a8ae499 100644 --- a/gnu/llvm/unittests/Support/FormatVariadicTest.cpp +++ b/gnu/llvm/unittests/Support/FormatVariadicTest.cpp @@ -7,8 +7,8 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/FormatAdapters.h" #include "llvm/Support/FormatVariadic.h" +#include "llvm/Support/FormatAdapters.h" #include "gtest/gtest.h" using namespace llvm; @@ -324,11 +324,13 @@ TEST(FormatVariadicTest, StringFormatting) { const char FooArray[] = "FooArray"; const char *FooPtr = "FooPtr"; llvm::StringRef FooRef("FooRef"); + constexpr StringLiteral FooLiteral("FooLiteral"); std::string FooString("FooString"); // 1. Test that we can print various types of strings. EXPECT_EQ(FooArray, formatv("{0}", FooArray).str()); EXPECT_EQ(FooPtr, formatv("{0}", FooPtr).str()); EXPECT_EQ(FooRef, formatv("{0}", FooRef).str()); + EXPECT_EQ(FooLiteral, formatv("{0}", FooLiteral).str()); EXPECT_EQ(FooString, formatv("{0}", FooString).str()); // 2. Test that the precision specifier prints the correct number of @@ -540,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()); |
