[PATCH] D34623: [clang-format] Add a test for associative map proto buffer fields

Krasimir Georgiev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 26 08:40:29 PDT 2017


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

- Add map declarations spanning multiple lines


https://reviews.llvm.org/D34623

Files:
  unittests/Format/FormatTestProto.cpp


Index: unittests/Format/FormatTestProto.cpp
===================================================================
--- unittests/Format/FormatTestProto.cpp
+++ unittests/Format/FormatTestProto.cpp
@@ -61,6 +61,29 @@
                "      really.really.long.qualified.type.aaa.aaaaaaa.aaaaaaaa\n"
                "          another_fiiiiiiiiiiiiiiiiiiiiield = 2;\n"
                "}");
+  verifyFormat("message SomeMessage {\n"
+               "  map<string, Project> projects = 1;\n"
+               "  optional map<string, int32> size_projects = 2;\n"
+               "  map<int, really.really.really.long.qualified.type.nameeee>\n"
+               "      projects = 3;\n"
+               "  map<int, really.really.really.really.long.qualified.type\n"
+               "               .nameeee> projects = 4;\n"
+               "  map<int,\n"
+               "      reallyreallyreallyreallyreallyreallyreallylongname>\n"
+               "      projects = 5;\n"
+               "  map<int, Project>\n"
+               "      longlonglonglonglonglonglonglonglonglongonglon = 6;\n"
+               "  map<releleallyreallyreallyreallyreallyreallyreallylongname,\n"
+               "      int> projects = 7;\n"
+               "  map<releleallyreallyreallyreallyreallyreallyreallylongname,\n"
+               "      releleallyreallyreallyreallyreallyreallyreallylongname>\n"
+               "      releleallyreallyreallyreallyreallyreallyreallylongnam =\n"
+               "          8;\n"
+               "  map<relele.llyreal.yreallyr.allyreally.eallyreal\n"
+               "          .sauenirylongname,\n"
+               "      really.really.really.really.long.qualified.type\n"
+               "          .nameeee> projects = 9;\n"
+               "}");
 }
 
 TEST_F(FormatTestProto, KeywordsInOtherLanguages) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34623.103962.patch
Type: text/x-patch
Size: 1813 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170626/692b3a66/attachment.bin>


More information about the cfe-commits mailing list