summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r--clang/unittests/Format/FormatTestProto.cpp12
-rw-r--r--clang/unittests/Format/FormatTestTextProto.cpp12
2 files changed, 24 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp
index 1d6b7502e09..6db44c765b4 100644
--- a/clang/unittests/Format/FormatTestProto.cpp
+++ b/clang/unittests/Format/FormatTestProto.cpp
@@ -478,5 +478,17 @@ TEST_F(FormatTestProto, FormatsRepeatedListInitializersInOptions) {
"};");
}
+TEST_F(FormatTestProto, AcceptsOperatorAsKeyInOptions) {
+ verifyFormat("option (MyProto.options) = {\n"
+ " bbbbbbbbb: <\n"
+ " ccccccccccccccccccccccc: <\n"
+ " operator: 1\n"
+ " operator: 2\n"
+ " operator { key: value }\n"
+ " >\n"
+ " >\n"
+ "};");
+}
+
} // end namespace tooling
} // end namespace clang
diff --git a/clang/unittests/Format/FormatTestTextProto.cpp b/clang/unittests/Format/FormatTestTextProto.cpp
index 17cde61d2af..1102055ea37 100644
--- a/clang/unittests/Format/FormatTestTextProto.cpp
+++ b/clang/unittests/Format/FormatTestTextProto.cpp
@@ -440,5 +440,17 @@ TEST_F(FormatTestTextProto, FormatsRepeatedListInitializers) {
Style.Cpp11BracedListStyle = true;
verifyFormat("keys: [1]", Style);
}
+
+TEST_F(FormatTestTextProto, AcceptsOperatorAsKey) {
+ verifyFormat("aaaaaaaaaaa: <\n"
+ " bbbbbbbbb: <\n"
+ " ccccccccccccccccccccccc: <\n"
+ " operator: 1\n"
+ " operator: 2\n"
+ " operator { key: value }\n"
+ " >\n"
+ " >\n"
+ ">");
+}
} // end namespace tooling
} // end namespace clang
OpenPOWER on IntegriCloud