diff options
author | Cameron Desrochers <cameron@moodycamel.com> | 2016-11-15 15:07:07 +0000 |
---|---|---|
committer | Cameron Desrochers <cameron@moodycamel.com> | 2016-11-15 15:07:07 +0000 |
commit | 1991e5d67330f3d02a5440937a2d0df106c0eda7 (patch) | |
tree | a3e181f60894f3a59da509c50e392643cca51edd /clang/unittests/Format | |
parent | 6a49aad177753474b0834c42ca319682af0befc5 (diff) | |
download | bcm5719-llvm-1991e5d67330f3d02a5440937a2d0df106c0eda7.tar.gz bcm5719-llvm-1991e5d67330f3d02a5440937a2d0df106c0eda7.zip |
[clang-format] Fixed line merging of more than two lines
Differential Revision: https://reviews.llvm.org/D19063
llvm-svn: 286973
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 9ce888d548b..e8e36abe681 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -276,6 +276,30 @@ TEST_F(FormatTest, RemovesEmptyLines) { "int i;\n" "\n" "} // namespace")); + + FormatStyle Style = getLLVMStyle(); + Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All; + Style.MaxEmptyLinesToKeep = 2; + Style.BreakBeforeBraces = FormatStyle::BS_Custom; + Style.BraceWrapping.AfterClass = true; + Style.BraceWrapping.AfterFunction = true; + Style.KeepEmptyLinesAtTheStartOfBlocks = false; + + EXPECT_EQ("class Foo\n" + "{\n" + " Foo() {}\n" + "\n" + " void funk() {}\n" + "};", + format("class Foo\n" + "{\n" + " Foo()\n" + " {\n" + " }\n" + "\n" + " void funk() {}\n" + "};", + Style)); } TEST_F(FormatTest, RecognizesBinaryOperatorKeywords) { |