================
@@ -332,6 +332,429 @@ TEST_F(FormatTestComments, UnderstandsSingleLineComments) 
{
   verifyNoCrash(StringRef("/*\\\0\n/", 6));
 }
 
+TEST_F(FormatTestComments, InsertsSpaceAfterOpeningBlockComment) {
----------------
Men-cotton wrote:

I added the reflow tests 
(https://github.com/llvm/llvm-project/pull/162105/commits/124584f2a7dc06490206174f87038786261f4b33).

I also introduced `getReflowedCommentLine` to address an issue where 
conventional verification causes incorrect line breaking. Without this helper, 
the test below fails because the comments are reflown differently than expected:

Test case:
```c++
  Style.SpaceInComments.AfterOpeningComment =
      FormatStyle::CommentSpaceMode::Never;
  Style.SpaceInComments.BeforeClosingComment =
      FormatStyle::CommentSpaceMode::Never;
  verifyFormat("/*long long long long\n"
               " * long*/",
               "/*  long long long long long  */", Style);
```
Actual output without helper:
```c++
  verifyFormat("/*long long long\n"
               " * long long*/",
               "/*  long long long long long  */", Style);
```

https://github.com/llvm/llvm-project/pull/162105
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to