aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestComments.cpp
diff options
context:
space:
mode:
authorksyx <18738953+ksyx@users.noreply.github.com>2022-02-02 22:18:09 -0500
committerksyx <18738953+ksyx@users.noreply.github.com>2022-02-03 21:49:10 +0000
commit88e4e6be16ea400948c06f972f1b5f19478528df (patch)
tree7f57da5f711870d4f813c6bb6b201fd3e49c65b5 /clang/unittests/Format/FormatTestComments.cpp
parenta5cff6af1d342e1523daae26231aeccb0ca17e39 (diff)
downloadllvm-88e4e6be16ea400948c06f972f1b5f19478528df.zip
llvm-88e4e6be16ea400948c06f972f1b5f19478528df.tar.gz
llvm-88e4e6be16ea400948c06f972f1b5f19478528df.tar.bz2
[clang-format] Use wider comment prefix space rule
This commit changes the condition of requiring comment to start with alphanumeric characters to make no change only for a certain set of characters, currently horizontal whitespace and punctuation characters, to support wider set of leading characters unrelated to documentation generation directives. Reviewed By: HazardyKnusperkeks Differential Revision: https://reviews.llvm.org/D118869
Diffstat (limited to 'clang/unittests/Format/FormatTestComments.cpp')
-rw-r--r--clang/unittests/Format/FormatTestComments.cpp84
1 files changed, 84 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestComments.cpp b/clang/unittests/Format/FormatTestComments.cpp
index b487440..282bc46 100644
--- a/clang/unittests/Format/FormatTestComments.cpp
+++ b/clang/unittests/Format/FormatTestComments.cpp
@@ -3322,6 +3322,18 @@ TEST_F(FormatTestComments, SpaceAtLineCommentBegin) {
"\n"
"/// Free Doxygen with 3 spaces\n"
"\n"
+ "//🐉 A nice dragon\n"
+ "\n"
+ "//\t abccba\n"
+ "\n"
+ "//\\t deffed\n"
+ "\n"
+ "// 🐉 Another nice dragon\n"
+ "\n"
+ "// \t Three leading spaces following tab\n"
+ "\n"
+ "// \\t Three leading spaces following backslash\n"
+ "\n"
"/// A Doxygen Comment with a nested list:\n"
"/// - Foo\n"
"/// - Bar\n"
@@ -3381,6 +3393,18 @@ TEST_F(FormatTestComments, SpaceAtLineCommentBegin) {
"\n"
"/// Free Doxygen with 3 spaces\n"
"\n"
+ "// 🐉 A nice dragon\n"
+ "\n"
+ "//\t abccba\n"
+ "\n"
+ "//\\t deffed\n"
+ "\n"
+ "// 🐉 Another nice dragon\n"
+ "\n"
+ "// \t Three leading spaces following tab\n"
+ "\n"
+ "// \\t Three leading spaces following backslash\n"
+ "\n"
"/// A Doxygen Comment with a nested list:\n"
"/// - Foo\n"
"/// - Bar\n"
@@ -3442,6 +3466,18 @@ TEST_F(FormatTestComments, SpaceAtLineCommentBegin) {
"\n"
"///Free Doxygen with 3 spaces\n"
"\n"
+ "//🐉 A nice dragon\n"
+ "\n"
+ "//\t abccba\n"
+ "\n"
+ "//\\t deffed\n"
+ "\n"
+ "//🐉 Another nice dragon\n"
+ "\n"
+ "//\t Three leading spaces following tab\n"
+ "\n"
+ "//\\t Three leading spaces following backslash\n"
+ "\n"
"///A Doxygen Comment with a nested list:\n"
"///- Foo\n"
"///- Bar\n"
@@ -3503,6 +3539,18 @@ TEST_F(FormatTestComments, SpaceAtLineCommentBegin) {
"\n"
"/// Free Doxygen with 3 spaces\n"
"\n"
+ "// 🐉 A nice dragon\n"
+ "\n"
+ "//\t abccba\n"
+ "\n"
+ "//\\t deffed\n"
+ "\n"
+ "// 🐉 Another nice dragon\n"
+ "\n"
+ "// \t Three leading spaces following tab\n"
+ "\n"
+ "// \\t Three leading spaces following backslash\n"
+ "\n"
"/// A Doxygen Comment with a nested list:\n"
"/// - Foo\n"
"/// - Bar\n"
@@ -3809,6 +3857,18 @@ TEST_F(FormatTestComments, SpaceAtLineCommentBegin) {
"\n"
"/// Free Doxygen with 3 spaces\n"
"\n"
+ "// 🐉 A nice dragon\n"
+ "\n"
+ "//\t abccba\n"
+ "\n"
+ "//\\t deffed\n"
+ "\n"
+ "// 🐉 Another nice dragon\n"
+ "\n"
+ "// \t Three leading spaces following tab\n"
+ "\n"
+ "// \\t Three leading spaces following backslash\n"
+ "\n"
"/// A Doxygen Comment with a nested list:\n"
"/// - Foo\n"
"/// - Bar\n"
@@ -3870,6 +3930,18 @@ TEST_F(FormatTestComments, SpaceAtLineCommentBegin) {
"\n"
"///Free Doxygen with 3 spaces\n"
"\n"
+ "//🐉 A nice dragon\n"
+ "\n"
+ "//\t abccba\n"
+ "\n"
+ "//\\t deffed\n"
+ "\n"
+ "//🐉 Another nice dragon\n"
+ "\n"
+ "//\t Three leading spaces following tab\n"
+ "\n"
+ "//\\t Three leading spaces following backslash\n"
+ "\n"
"///A Doxygen Comment with a nested list:\n"
"///- Foo\n"
"///- Bar\n"
@@ -3931,6 +4003,18 @@ TEST_F(FormatTestComments, SpaceAtLineCommentBegin) {
"\n"
"/// Free Doxygen with 3 spaces\n"
"\n"
+ "// 🐉 A nice dragon\n"
+ "\n"
+ "//\t abccba\n"
+ "\n"
+ "//\\t deffed\n"
+ "\n"
+ "// 🐉 Another nice dragon\n"
+ "\n"
+ "// \t Three leading spaces following tab\n"
+ "\n"
+ "// \\t Three leading spaces following backslash\n"
+ "\n"
"/// A Doxygen Comment with a nested list:\n"
"/// - Foo\n"
"/// - Bar\n"