summaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTestProto.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2018-02-19 15:31:25 +0000
committerKrasimir Georgiev <krasimir@google.com>2018-02-19 15:31:25 +0000
commit4337e351aaa5407ba3cd73782ce2892a8625028e (patch)
tree2a26e511e1f348952527aa24d31a0ac6f20fd7a4 /unittests/Format/FormatTestProto.cpp
parent72299bf3908a14a283a9d10b14656c661e6b079d (diff)
downloadclang-4337e351aaa5407ba3cd73782ce2892a8625028e.tar.gz
[clang-format] Fixup a case of text proto message attributes
Summary: This patch fixes a case where a proto message attribute is wrongly identified as an text proto extension. Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43465 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325509 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTestProto.cpp')
-rw-r--r--unittests/Format/FormatTestProto.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/unittests/Format/FormatTestProto.cpp b/unittests/Format/FormatTestProto.cpp
index 4c61ec1398..1d6b7502e0 100644
--- a/unittests/Format/FormatTestProto.cpp
+++ b/unittests/Format/FormatTestProto.cpp
@@ -168,6 +168,16 @@ TEST_F(FormatTestProto, MessageFieldAttributes) {
" aaaaaaaaaaaaaaaa: true\n"
" }\n"
"];");
+ verifyFormat("extensions 20 [(proto2.type) = 'Aaaa.bbbb'];");
+ verifyFormat("extensions 20\n"
+ " [(proto3.type) = 'Aaaa.bbbb', (aaa.Aaa) = 'aaa.bbb'];");
+ verifyFormat("extensions 123 [\n"
+ " (aaa) = aaaa,\n"
+ " (bbbbbbbbbbbbbbbbbbbbbbbbbb) = {\n"
+ " aaaaaaaaaaaaaaaaa: true,\n"
+ " aaaaaaaaaaaaaaaa: true\n"
+ " }\n"
+ "];");
}
TEST_F(FormatTestProto, DoesntWrapFileOptions) {