Skip to content

Commit

Permalink
[clang-format] Add a test for associative map proto buffer fields
Browse files Browse the repository at this point in the history
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
  • Loading branch information
krasimirgg committed Jun 27, 2017
1 parent d34a65d commit 9451e67
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions clang/unittests/Format/FormatTestProto.cpp
Expand Up @@ -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) {
Expand Down

0 comments on commit 9451e67

Please sign in to comment.