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.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestTextProto.cpp b/clang/unittests/Format/FormatTestTextProto.cpp
index 9c4e1a85205..0875bd8925d 100644
--- a/clang/unittests/Format/FormatTestTextProto.cpp
+++ b/clang/unittests/Format/FormatTestTextProto.cpp
@@ -717,5 +717,23 @@ TEST_F(FormatTestTextProto, FormatsCommentsAtEndOfFile) {
"# endfile comment");
}
+TEST_F(FormatTestTextProto, KeepsAmpersandsNextToKeys) {
+ verifyFormat("@tmpl { field: 1 }");
+ verifyFormat("@placeholder: 1");
+ verifyFormat("@name <>");
+ verifyFormat("submessage: @base { key: value }");
+ verifyFormat("submessage: @base {\n"
+ " key: value\n"
+ " item: {}\n"
+ "}");
+ verifyFormat("submessage: {\n"
+ " msg: @base {\n"
+ " yolo: {}\n"
+ " key: value\n"
+ " }\n"
+ " key: value\n"
+ "}");
+}
+
} // end namespace tooling
} // end namespace clang
OpenPOWER on IntegriCloud