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.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestTextProto.cpp b/clang/unittests/Format/FormatTestTextProto.cpp
index 8ef4bf9a40a..9c4e1a85205 100644
--- a/clang/unittests/Format/FormatTestTextProto.cpp
+++ b/clang/unittests/Format/FormatTestTextProto.cpp
@@ -700,5 +700,22 @@ TEST_F(FormatTestTextProto, PreventBreaksBetweenKeyAndSubmessages) {
"}");
}
+TEST_F(FormatTestTextProto, FormatsCommentsAtEndOfFile) {
+ verifyFormat("key: value\n"
+ "# endfile comment");
+ verifyFormat("key: value\n"
+ "// endfile comment");
+ verifyFormat("key: value\n"
+ "// endfile comment 1\n"
+ "// endfile comment 2");
+ verifyFormat("submessage { key: value }\n"
+ "# endfile comment");
+ verifyFormat("submessage <\n"
+ " key: value\n"
+ " item {}\n"
+ ">\n"
+ "# endfile comment");
+}
+
} // end namespace tooling
} // end namespace clang
OpenPOWER on IntegriCloud