[PATCH] D151761: clang-format: Add AlignConsecutiveShortCaseStatements

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 3 12:04:08 PDT 2023


HazardyKnusperkeks accepted this revision.
HazardyKnusperkeks added a comment.
This revision is now accepted and ready to land.

Please wait for some other approval (or comments) for a few days.



================
Comment at: clang/unittests/Format/FormatTest.cpp:19218
+  // Verify comments and empty lines break the alignment
+  verifyFormat("switch (level) {\n"
+               "case log::info:    return \"info\";\n"
----------------
galenelias wrote:
> HazardyKnusperkeks wrote:
> > If both strings are the same, you only need to supply it once.
> > 
> > Or are they different and I can't see it?
> They are the same, but I can't use the single string version, as that one calls test::messUp on the string which will strip blank lines, which then invalidates the test case.  It seems pretty much all tests which are trying to validate behavior around empty spaces has to use the two string version.
Check.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151761/new/

https://reviews.llvm.org/D151761



More information about the cfe-commits mailing list