summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestProto.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2017-06-27 10:06:40 +0000
committerKrasimir Georgiev <krasimir@google.com>2017-06-27 10:06:40 +0000
commit9451e67158d252099b73508be98f3e07fbcbe8dc (patch)
treef6dd5767a2689579b4176d597ae72c9000e8c088 /clang/unittests/Format/FormatTestProto.cpp
parentd34a65d6b689e2c8d765c8e36d4b085e5e1e9c23 (diff)
downloadbcm5719-llvm-9451e67158d252099b73508be98f3e07fbcbe8dc.tar.gz
bcm5719-llvm-9451e67158d252099b73508be98f3e07fbcbe8dc.zip
[clang-format] Add a test for associative map proto buffer fields
Summary: The test suite was missing a test about associative maps: https://developers.google.com/protocol-buffers/docs/proto3#maps Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D34623 llvm-svn: 306386
Diffstat (limited to 'clang/unittests/Format/FormatTestProto.cpp')
-rw-r--r--clang/unittests/Format/FormatTestProto.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp
index d174c65a1f3..3f690c369ba 100644
--- a/clang/unittests/Format/FormatTestProto.cpp
+++ b/clang/unittests/Format/FormatTestProto.cpp
@@ -61,6 +61,29 @@ TEST_F(FormatTestProto, FormatsMessages) {
" 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) {
OpenPOWER on IntegriCloud