summaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTestProto.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2017-03-14 00:40:32 +0000
committerDaniel Jasper <djasper@google.com>2017-03-14 00:40:32 +0000
commitecff61e5ae69ac0933a28035e08a8c2c10d44911 (patch)
tree5eec79e229965ff61ecc01717f6539d9aa6ffc4a /unittests/Format/FormatTestProto.cpp
parent370e396b7267af8a7ac0d84f847029a590d638a6 (diff)
downloadclang-ecff61e5ae69ac0933a28035e08a8c2c10d44911.tar.gz
clang-format: Make it very slighly more expensive to wrap between "= {".
This prevents unwanted fallout from r296664. Specifically in proto formatting, this changed: optional Aaaaaaaa aaaaaaaa = 12 [ (aaa) = aaaa, (bbbbbbbbbbbbbbbbbbbbbbbbbb) = { aaaaaaaaaaaaaaaaa: true, aaaaaaaaaaaaaaaa: true } ]; Into: optional Aaaaaaaa aaaaaaaa = 12 [ (aaa) = aaaa, (bbbbbbbbbbbbbbbbbbbbbbbbbb) = {aaaaaaaaaaaaaaaaa: true, aaaaaaaaaaaaaaaa: true} ]; Which is considered less readable. Generally, it seems preferable to format such dict literals as blocks rather than contract them to one line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTestProto.cpp')
-rw-r--r--unittests/Format/FormatTestProto.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/Format/FormatTestProto.cpp b/unittests/Format/FormatTestProto.cpp
index 41d210ac7c..d174c65a1f 100644
--- a/unittests/Format/FormatTestProto.cpp
+++ b/unittests/Format/FormatTestProto.cpp
@@ -138,6 +138,13 @@ TEST_F(FormatTestProto, MessageFieldAttributes) {
verifyFormat("optional string test = 1 [default =\n"
" \"test\"\n"
" \"test\"];");
+ verifyFormat("optional Aaaaaaaa aaaaaaaa = 12 [\n"
+ " (aaa) = aaaa,\n"
+ " (bbbbbbbbbbbbbbbbbbbbbbbbbb) = {\n"
+ " aaaaaaaaaaaaaaaaa: true,\n"
+ " aaaaaaaaaaaaaaaa: true\n"
+ " }\n"
+ "];");
}
TEST_F(FormatTestProto, DoesntWrapFileOptions) {