aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestComments.cpp
diff options
context:
space:
mode:
authorMarek Kurdej <marek.kurdej+llvm.org@gmail.com>2022-02-13 21:56:37 +0100
committerMarek Kurdej <marek.kurdej+llvm.org@gmail.com>2022-02-14 09:53:16 +0100
commite967d97a35a93c883528a9672159edff05f5addb (patch)
treef808556c677fccd76b241ffd84234d589be780c6 /clang/unittests/Format/FormatTestComments.cpp
parent5217801daefbcad25ece6c784fea1d05244cf34c (diff)
downloadllvm-e967d97a35a93c883528a9672159edff05f5addb.zip
llvm-e967d97a35a93c883528a9672159edff05f5addb.tar.gz
llvm-e967d97a35a93c883528a9672159edff05f5addb.tar.bz2
[clang-format] Fix SpacesInLineCommentPrefix deleting tokens.
Fixes https://github.com/llvm/llvm-project/issues/53799. Reviewed By: HazardyKnusperkeks, owenpan Differential Revision: https://reviews.llvm.org/D119680
Diffstat (limited to 'clang/unittests/Format/FormatTestComments.cpp')
-rw-r--r--clang/unittests/Format/FormatTestComments.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestComments.cpp b/clang/unittests/Format/FormatTestComments.cpp
index dcfd219..8cdca0e 100644
--- a/clang/unittests/Format/FormatTestComments.cpp
+++ b/clang/unittests/Format/FormatTestComments.cpp
@@ -3645,6 +3645,11 @@ TEST_F(FormatTestComments, SpaceAtLineCommentBegin) {
" // World\n"
"}",
format(WrapCode, Style));
+ EXPECT_EQ("// x\n"
+ "// y",
+ format("// x\n"
+ "// y",
+ Style));
Style.SpacesInLineCommentPrefix = {3, 3};
EXPECT_EQ("// Lorem ipsum\n"