diff options
Diffstat (limited to 'clang/unittests/Format/FormatTestTextProto.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTestTextProto.cpp | 17 |
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 |

