summaryrefslogtreecommitdiffstats
path: root/clang/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
commit9b2aa42f00253d5a5fd8153bfb28481a62beb8d9 (patch)
treea925669d363fc775a07d350c976db8780fa076ae /clang/unittests/Format/FormatTestProto.cpp
parentb040fcc693447c3d43dfb4623976a921cb1fa0b8 (diff)
downloadbcm5719-llvm-9b2aa42f00253d5a5fd8153bfb28481a62beb8d9.tar.gz
bcm5719-llvm-9b2aa42f00253d5a5fd8153bfb28481a62beb8d9.zip
[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 llvm-svn: 325509
Diffstat (limited to 'clang/unittests/Format/FormatTestProto.cpp')
-rw-r--r--clang/unittests/Format/FormatTestProto.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp
index 4c61ec1398f..1d6b7502e09 100644
--- a/clang/unittests/Format/FormatTestProto.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud