From: Krasimir Georgiev Date: Tue, 27 Jun 2017 10:06:40 +0000 (+0000) Subject: [clang-format] Add a test for associative map proto buffer fields X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8be210b0a28c079aa07ffdb46d8e274bc9e4be70;p=clang [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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@306386 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/Format/FormatTestProto.cpp b/unittests/Format/FormatTestProto.cpp index d174c65a1f..3f690c369b 100644 --- a/unittests/Format/FormatTestProto.cpp +++ b/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 projects = 1;\n" + " optional map size_projects = 2;\n" + " map\n" + " projects = 3;\n" + " map projects = 4;\n" + " map\n" + " projects = 5;\n" + " map\n" + " longlonglonglonglonglonglonglonglonglongonglon = 6;\n" + " map projects = 7;\n" + " map\n" + " releleallyreallyreallyreallyreallyreallyreallylongnam =\n" + " 8;\n" + " map projects = 9;\n" + "}"); } TEST_F(FormatTestProto, KeywordsInOtherLanguages) {