diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-16 17:00:50 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-16 17:00:50 +0000 |
commit | 16618240a8a28d84de6d950f89145a78645e26e7 (patch) | |
tree | 72cd0141220afaffe7ab2dae0baedacd7fc2c862 /unittests/Format/FormatTest.cpp | |
parent | 36845474e217b952c720f4f87923bc78059640c5 (diff) |
Fix a bug where we would move a following line into a comment.
Before: Constructor() : a(a), // comment a(a) {}
After: Constructor() : a(a), // comment
a(a) {}
Needed this as a quick fix. Will add more tests for this in a future
commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-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 3c92d82f8f..df050a4e29 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -746,6 +746,11 @@ TEST_F(FormatTest, ConstructorInitializers) { " : aaaaaaaaaaaaa(aaaaaaaaaaaaaa),\n" " aaaaaaaaaaaaa(aaaaaaaaaaaaaa),\n" " aaaaaaaaaaaaa(aaaaaaaaaaaaaa) {}"); + verifyGoogleFormat( + "SomeClass::Constructor()\n" + " : aaaaaaaaaaaaa(aaaaaaaaaaaaaa), // Some comment\n" + " aaaaaaaaaaaaa(aaaaaaaaaaaaaa),\n" + " aaaaaaaaaaaaa(aaaaaaaaaaaaaa) {}"); verifyFormat( "SomeClass::Constructor()\n" |