aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Support/CommandLineTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
-rw-r--r--llvm/unittests/Support/CommandLineTest.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/unittests/Support/CommandLineTest.cpp b/llvm/unittests/Support/CommandLineTest.cpp
index a05f389..4accdc5 100644
--- a/llvm/unittests/Support/CommandLineTest.cpp
+++ b/llvm/unittests/Support/CommandLineTest.cpp
@@ -1263,6 +1263,28 @@ TEST_F(PrintOptionInfoTest, PrintOptionInfoEmptyValueDescription) {
// clang-format on
}
+TEST_F(PrintOptionInfoTest, PrintOptionInfoMultilineValueDescription) {
+ std::string Output =
+ runTest(cl::ValueRequired,
+ cl::values(clEnumValN(OptionValue::Val, "v1",
+ "This is the first enum value\n"
+ "which has a really long description\n"
+ "thus it is multi-line."),
+ clEnumValN(OptionValue::Val, "",
+ "This is an unnamed enum value option\n"
+ "Should be indented as well")));
+
+ // clang-format off
+ EXPECT_EQ(Output,
+ (" --" + Opt + "=<value> - " + HelpText + "\n"
+ " =v1 - This is the first enum value\n"
+ " which has a really long description\n"
+ " thus it is multi-line.\n"
+ " =<empty> - This is an unnamed enum value option\n"
+ " Should be indented as well\n").str());
+ // clang-format on
+}
+
class GetOptionWidthTest : public ::testing::Test {
public:
enum class OptionValue { Val };