diff options
author | Luis Penagos <luis@penagos.co> | 2022-02-20 21:35:47 +0100 |
---|---|---|
committer | Marek Kurdej <marek.kurdej+llvm.org@gmail.com> | 2022-02-20 21:53:50 +0100 |
commit | d9567babef302cfd7e827df64138151ba2614b83 (patch) | |
tree | e3bef1e41540ad56b8e9566e00bde9293ecfb8a4 /clang/unittests/Format/FormatTestComments.cpp | |
parent | d0505201c468ec9ed7f738af0ae3da58faf24a0f (diff) | |
download | llvm-d9567babef302cfd7e827df64138151ba2614b83.zip llvm-d9567babef302cfd7e827df64138151ba2614b83.tar.gz llvm-d9567babef302cfd7e827df64138151ba2614b83.tar.bz2 |
Fix extraneous whitespace addition in line comments on clang-format directives
Fixes https://github.com/llvm/llvm-project/issues/53844.
I believe this regression was caused by not accounting for clang-format directives in https://reviews.llvm.org/D92257.
Reviewed By: HazardyKnusperkeks, curdeius
Differential Revision: https://reviews.llvm.org/D120188
Diffstat (limited to 'clang/unittests/Format/FormatTestComments.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestComments.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestComments.cpp b/clang/unittests/Format/FormatTestComments.cpp index c988a28..f83ffb3 100644 --- a/clang/unittests/Format/FormatTestComments.cpp +++ b/clang/unittests/Format/FormatTestComments.cpp @@ -91,6 +91,11 @@ TEST_F(FormatTestComments, UnderstandsSingleLineComments) { "// line 2\n" "void f() {}\n"); + EXPECT_EQ("// comment\n" + "// clang-format on\n", + format("//comment\n" + "// clang-format on\n")); + verifyFormat("void f() {\n" " // Doesn't do anything\n" "}"); |