diff options
author | Daniel Jasper <djasper@google.com> | 2015-07-15 16:26:47 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-07-15 16:26:47 +0000 |
commit | bfbaed9ca73cba98737766f0145ffd8c7838895b (patch) | |
tree | 8c9165cc99078f6ac3823d8fde16293085a2e433 /unittests | |
parent | 83bcf1c6654c6a2b4ee3fcccd4ac6668f87a11d5 (diff) | |
download | clang-bfbaed9ca73cba98737766f0145ffd8c7838895b.tar.gz |
clang-format: Fix column layout with a comment in the last line.
Before:
int aaaaa[] = {
1, 2,
3, // comment
4, 5,
6 // comment
};
After:
int aaaaa[] = {
1, 2, 3, // comment
4, 5, 6 // comment
};
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index d61dc7f662..886f58093d 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -6307,6 +6307,11 @@ TEST_F(FormatTest, FormatsBracedListsInColumnLayout) { " 1111111111, 2222222222, 33333333333, 4444444444, //\n" " 111111111, 222222222, 3333333333, 444444444, //\n" " 11111111, 22222222, 333333333, 44444444};"); + // Trailing comment in the last line. + verifyFormat("int aaaaa[] = {\n" + " 1, 2, 3, // comment\n" + " 4, 5, 6 // comment\n" + "};"); // With nested lists, we should either format one item per line or all nested // lists one on line. |