summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestTextProto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format/FormatTestTextProto.cpp')
-rw-r--r--clang/unittests/Format/FormatTestTextProto.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestTextProto.cpp b/clang/unittests/Format/FormatTestTextProto.cpp
index 4e4387b9d38..6088409b2ff 100644
--- a/clang/unittests/Format/FormatTestTextProto.cpp
+++ b/clang/unittests/Format/FormatTestTextProto.cpp
@@ -469,6 +469,7 @@ TEST_F(FormatTestTextProto, AcceptsOperatorAsKey) {
" ccccccccccccccccccccccc: <\n"
" operator: 1\n"
" operator: 2\n"
+ " operator: 3\n"
" operator { key: value }\n"
" >\n"
" >\n"
@@ -495,5 +496,16 @@ TEST_F(FormatTestTextProto, PutsMultipleEntriesInExtensionsOnNewlines) {
"}", Style);
}
+TEST_F(FormatTestTextProto, BreaksAfterBraceFollowedByClosingBraceOnNextLine) {
+ FormatStyle Style = getGoogleStyle(FormatStyle::LK_TextProto);
+ Style.ColumnLimit = 60;
+ verifyFormat("keys: [\n"
+ " data: { item: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }\n"
+ "]");
+ verifyFormat("keys: <\n"
+ " data: { item: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' }\n"
+ ">");
+}
+
} // end namespace tooling
} // end namespace clang
OpenPOWER on IntegriCloud