diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-21 22:49:20 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-21 22:49:20 +0000 |
commit | 821627e5865c29357aef0e4f175b0abd083bf191 (patch) | |
tree | 76688f04da52bb84480fec6e1e0f3d7fce6fdded /unittests/Format/FormatTest.cpp | |
parent | ed01f84d20a1586b2d639b47463cf1f22418f0f6 (diff) |
Remove "incorrect" aligning of trailing comments.
We used to align trailing comments belong to different things.
Before:
void f() { // some function..
}
int a; // some variable..
After:
void f() { // some function..
}
int a; // some variable..
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index c9b255ce41..ba6d7519c6 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -404,6 +404,21 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) { " // Comment inside a statement.\n" " bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;"); + EXPECT_EQ("void f() { // This does something ..\n" + "}\n" + "int a; // This is unrelated", + format("void f() { // This does something ..\n" + " }\n" + "int a; // This is unrelated")); + EXPECT_EQ("void f() { // This does something ..\n" + "} // awesome..\n" + "\n" + "int a; // This is unrelated", + format("void f() { // This does something ..\n" + " } // awesome..\n" + " \n" + "int a; // This is unrelated")); + EXPECT_EQ("int i; // single line trailing comment", format("int i;\\\n// single line trailing comment")); |