aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestComments.cpp
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2025-07-10 18:14:45 -0700
committerGitHub <noreply@github.com>2025-07-10 18:14:45 -0700
commitcb52efb8936c0da0a03958daa95d45eaaf8806fb (patch)
tree8c7813a8e023e469a2da4698f295c363bcebf714 /clang/unittests/Format/FormatTestComments.cpp
parent7704f817d0a60596c4c8883c8a8ece67f0a8255a (diff)
downloadllvm-cb52efb8936c0da0a03958daa95d45eaaf8806fb.zip
llvm-cb52efb8936c0da0a03958daa95d45eaaf8806fb.tar.gz
llvm-cb52efb8936c0da0a03958daa95d45eaaf8806fb.tar.bz2
[clang-format] Split line comments separated by backslashes (#147648)
Fixes #147341
Diffstat (limited to 'clang/unittests/Format/FormatTestComments.cpp')
-rw-r--r--clang/unittests/Format/FormatTestComments.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/clang/unittests/Format/FormatTestComments.cpp b/clang/unittests/Format/FormatTestComments.cpp
index a16fbffb..8870755 100644
--- a/clang/unittests/Format/FormatTestComments.cpp
+++ b/clang/unittests/Format/FormatTestComments.cpp
@@ -747,16 +747,14 @@ TEST_F(FormatTestComments, DontSplitLineCommentsWithEscapedNewlines) {
" // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n"
" // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
getLLVMStyleWithColumns(50)));
- // FIXME: One day we might want to implement adjustment of leading whitespace
- // of the consecutive lines in this kind of comment:
- EXPECT_EQ("double\n"
- " a; // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n"
- " // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n"
- " // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
- format("double a; // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n"
- " // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n"
- " // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
- getLLVMStyleWithColumns(49)));
+ verifyFormat("double\n"
+ " a; // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n"
+ " // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n"
+ " // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
+ "double a; // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n"
+ " // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\\\n"
+ " // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
+ getLLVMStyleWithColumns(49));
}
TEST_F(FormatTestComments, DontIntroduceMultilineComments) {