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 | 304a986a7295483c0d9a7938a16107f1c3602666 (patch) | |
tree | 0936670908618db5477c1939c9dc70d1fe02c084 /clang/unittests/Format/FormatTest.cpp | |
parent | b7abb30d77b79b929b6e52d58ca8dc89688a3f2b (diff) | |
download | bcm5719-llvm-304a986a7295483c0d9a7938a16107f1c3602666.tar.gz bcm5719-llvm-304a986a7295483c0d9a7938a16107f1c3602666.zip |
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..
llvm-svn: 173100
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index c9b255ce414..ba6d7519c6c 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/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")); |