================
@@ -493,9 +493,36 @@ TEST_F(FormatTestComments, AlignsBlockComments) {
 
 TEST_F(FormatTestComments, CommentReflowingCanBeTurnedOff) {
   FormatStyle Style = getLLVMStyleWithColumns(20);
-  Style.ReflowComments = false;
-  verifyFormat("// aaaaaaaaa aaaaaaaaaa aaaaaaaaaa", Style);
-  verifyFormat("/* aaaaaaaaa aaaaaaaaaa aaaaaaaaaa */", Style);
+  Style.ReflowComments = FormatStyle::RCS_Never;
+  verifyNoChange("// aaaaaaaaa aaaaaaaaaa aaaaaaaaaa", Style);
+  verifyNoChange("/* aaaaaaaaa aaaaaaaaaa aaaaaaaaaa */", Style);
----------------
owenca wrote:

IIRC the main purpose of `messUp()` is to remove all syntactically optional 
newlines (and insert a single blank space if necessary). It also replaces 
consecutive whitespaces with a single one.

By convention we use `verifyFormat(x)` because it calls `messUp()`. Before I 
added `verifyNoChange()` and replaced hundreds of `verifyFormat(x, x)` with 
`verifyNoChange(x)`, the 2-argument `verifyFormat()` was the only way to avoid 
calling `messUp()`. Now we use `verifyFormat(output, input)` only when `input` 
and `output` differ, like the one you added on line 521 below.

So it would be better to use `verifyFormat()` here (consistency and no 
unrelated change) and below (consistency) even though `verifyNoChange()` would 
avoid an unnecessary call to `messUp()`.

https://github.com/llvm/llvm-project/pull/96804
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to