diff options
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 5a8b5d6f52b..1e898d8f721 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -6495,6 +6495,7 @@ TEST_F(FormatTest, ParsesConfiguration) { CHECK_PARSE("SpacesBeforeTrailingComments: 1234", SpacesBeforeTrailingComments, 1234u); CHECK_PARSE("IndentWidth: 32", IndentWidth, 32u); + CHECK_PARSE("ContinuationIndentWidth: 11", ContinuationIndentWidth, 11u); Style.Standard = FormatStyle::LS_Auto; CHECK_PARSE("Standard: Cpp03", Standard, FormatStyle::LS_Cpp03); @@ -6876,5 +6877,23 @@ TEST_F(FormatTest, MunchSemicolonAfterBlocks) { "};"); } +TEST_F(FormatTest, ConfigurableContinuationIndentWidth) { + FormatStyle TwoIndent = getLLVMStyleWithColumns(15); + TwoIndent.ContinuationIndentWidth = 2; + + EXPECT_EQ("int i =\n" + " longFunction(\n" + " arg);", + format("int i = longFunction(arg);", TwoIndent)); + + FormatStyle SixIndent = getLLVMStyleWithColumns(20); + SixIndent.ContinuationIndentWidth = 6; + + EXPECT_EQ("int i =\n" + " longFunction(\n" + " arg);", + format("int i = longFunction(arg);", SixIndent)); +} + } // end namespace tooling } // end namespace clang |