[PATCH] D151145: Add disabled unittest reproducing TextProto formatting issue.

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 12:15:59 PDT 2023


HazardyKnusperkeks added reviewers: MyDeveloperDay, owenpan, rymiel, HazardyKnusperkeks.
HazardyKnusperkeks added a comment.

As stated on Github I don't think we have a bug.



================
Comment at: clang/unittests/Format/FormatTestRawStrings.cpp:79
+)format";
+    llvm::MemoryBufferRef ConfigBuffer(FormatStr, "ClangFormatConfig");
+    FormatStyle Style = {};
----------------
Why such a raw string, instead of just `"(...)"`?


================
Comment at: clang/unittests/Format/FormatTestRawStrings.cpp:79
+)format";
+    llvm::MemoryBufferRef ConfigBuffer(FormatStr, "ClangFormatConfig");
+    FormatStyle Style = {};
----------------
HazardyKnusperkeks wrote:
> Why such a raw string, instead of just `"(...)"`?
I think `StringRef` would be the correct type.


================
Comment at: clang/unittests/Format/FormatTestRawStrings.cpp:92-99
     Style.RawStringFormats = {
         {
             /*Language=*/FormatStyle::LK_Cpp,
             /*Delimiters=*/{"cpp"},
             /*EnclosingFunctions=*/{},
             /*CanonicalDelimiter=*/"",
             BasedOnStyle,
----------------
Couldn't you just set the style like you want, instead of parsing yaml?


================
Comment at: clang/unittests/Format/FormatTestRawStrings.cpp:177
+            format(R"test(
+t = R"pb(item:1)pb";)test",
+                   getRawStringPbStyleSeparateSection()));
----------------
EXPECT_EQ


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151145



More information about the cfe-commits mailing list