Fix aligning of comments that are at the start of the line.
Now correctly leaves: f(); // comment // comment g(); // comment ... alone if the middle comment was aligned with g() before formatting. llvm-svn: 182605
This commit is contained in:
@@ -650,6 +650,13 @@ TEST_F(FormatTest, UnderstandsSingleLineComments) {
|
||||
format("lineWith(); // comment\n"
|
||||
" // at start\n"
|
||||
"otherLine();"));
|
||||
|
||||
EXPECT_EQ("lineWith(); // comment\n"
|
||||
"// at start\n"
|
||||
"otherLine(); // comment",
|
||||
format("lineWith(); // comment\n"
|
||||
"// at start\n"
|
||||
"otherLine(); // comment"));
|
||||
}
|
||||
|
||||
TEST_F(FormatTest, CanFormatCommentsLocally) {
|
||||
|
||||
Reference in New Issue
Block a user