[PATCH] D97688: clang-format: use `pb` as a canonical raw string delimiter for google style

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 4 02:03:07 PST 2021


krasimir updated this revision to Diff 328079.
krasimir added a comment.

Update tests


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97688

Files:
  clang/unittests/Format/FormatTestRawStrings.cpp


Index: clang/unittests/Format/FormatTestRawStrings.cpp
===================================================================
--- clang/unittests/Format/FormatTestRawStrings.cpp
+++ clang/unittests/Format/FormatTestRawStrings.cpp
@@ -782,11 +782,16 @@
 }
 
 TEST_F(FormatTestRawStrings, UpdatesToCanonicalDelimiters) {
-  FormatStyle Style = getRawStringPbStyleWithColumns(25);
+  FormatStyle Style = getRawStringPbStyleWithColumns(35);
   Style.RawStringFormats[0].CanonicalDelimiter = "proto";
+  Style.RawStringFormats[0].EnclosingFunctions.push_back("PARSE_TEXT_PROTO");
+
   expect_eq(R"test(a = R"proto(key: value)proto";)test",
             format(R"test(a = R"pb(key:value)pb";)test", Style));
 
+  expect_eq(R"test(PARSE_TEXT_PROTO(R"proto(key: value)proto");)test",
+            format(R"test(PARSE_TEXT_PROTO(R"(key:value)");)test", Style));
+
   // Don't update to canonical delimiter if it occurs as a raw string suffix in
   // the raw string content.
   expect_eq(R"test(a = R"pb(key: ")proto")pb";)test",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97688.328079.patch
Type: text/x-patch
Size: 1018 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210304/b8576512/attachment-0001.bin>


More information about the cfe-commits mailing list