diff options
author | Krasimir Georgiev <krasimir@google.com> | 2018-03-19 15:33:40 +0000 |
---|---|---|
committer | Krasimir Georgiev <krasimir@google.com> | 2018-03-19 15:33:40 +0000 |
commit | 5cca20f825e66eea684d5fb8c8303ee2b32456b4 (patch) | |
tree | 17edc810c4d08f68a7459eef60cf0d5a4a435a39 /clang/unittests/Format/FormatTest.cpp | |
parent | 0f0fb0a06f3275e2357b5e2cc9d1bd441fe4b0e7 (diff) | |
download | bcm5719-llvm-5cca20f825e66eea684d5fb8c8303ee2b32456b4.tar.gz bcm5719-llvm-5cca20f825e66eea684d5fb8c8303ee2b32456b4.zip |
[clang-format] Remove empty lines before }[;] // comment
Summary:
This addresses bug 36766 and a FIXME in tests about empty lines before
`}[;] // comment` lines.
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D44631
llvm-svn: 327861
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index a9fbe4b6fc3..bdb3fbe4835 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -276,7 +276,6 @@ TEST_F(FormatTest, RemovesEmptyLines) { "\n" "}")); - // FIXME: This is slightly inconsistent. FormatStyle LLVMWithNoNamespaceFix = getLLVMStyle(); LLVMWithNoNamespaceFix.FixNamespaceComments = false; EXPECT_EQ("namespace {\n" @@ -295,12 +294,25 @@ TEST_F(FormatTest, RemovesEmptyLines) { "}")); EXPECT_EQ("namespace {\n" "int i;\n" - "\n" + "};", + format("namespace {\n" + "int i;\n" + "\n" + "};")); + EXPECT_EQ("namespace {\n" + "int i;\n" "} // namespace", format("namespace {\n" "int i;\n" "\n" "} // namespace")); + EXPECT_EQ("namespace {\n" + "int i;\n" + "}; // namespace", + format("namespace {\n" + "int i;\n" + "\n" + "}; // namespace")); FormatStyle Style = getLLVMStyle(); Style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All; |