aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-21 22:49:20 +0000
committerDaniel Jasper <djasper@google.com>2013-01-21 22:49:20 +0000
commit821627e5865c29357aef0e4f175b0abd083bf191 (patch)
tree76688f04da52bb84480fec6e1e0f3d7fce6fdded /unittests/Format/FormatTest.cpp
parented01f84d20a1586b2d639b47463cf1f22418f0f6 (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.cpp15
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"));