diff options
author | Daniel Jasper <djasper@google.com> | 2013-02-20 12:56:39 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-02-20 12:56:39 +0000 |
commit | c4615b7aaf97e303a4fc675956f7f5572d492885 (patch) | |
tree | 77430a4d47484d505b20c7f635da4c9efc545dc3 /unittests/Format/FormatTest.cpp | |
parent | 8092a940922f307edb569036a3bb6bb722fb3a3d (diff) |
Don't remove blank lines within unwrapped lines.
If the code author decides to put empty lines anywhere into the code we
should treat them equally, i.e. reduce them to the configured
MaxEmptyLinesToKeep.
With this change, we e.g. keep the newline in:
SomeType ST = {
// First value
a,
// Second value
b
};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175620 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 4fefb9627e..dba6183e09 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -576,6 +576,20 @@ TEST_F(FormatTest, CommentsInStaticInitializers) { " d, e, f },\n" " { // Group #3\n" " g, h, i } };"); + + EXPECT_EQ("S s = {\n" + " // Some comment\n" + " a\n" + "\n" + " // Comment after empty line\n" + " b\n" + "}", format("S s = {\n" + " // Some comment\n" + " a\n" + " \n" + " // Comment after empty line\n" + " b\n" + "}")); } //===----------------------------------------------------------------------===// |