diff options
author | Daniel Jasper <djasper@google.com> | 2016-06-20 18:20:38 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-06-20 18:20:38 +0000 |
commit | 3d5a7d6b65ab7e19cd84e3041a1b663407dc61d8 (patch) | |
tree | b70af72774c66f09d71a18982136a3244a2b15e2 /clang/unittests/Format/FormatTestProto.cpp | |
parent | 4deb4ed21eda7d5e4fc3371a014249a36d7787b2 (diff) | |
download | bcm5719-llvm-3d5a7d6b65ab7e19cd84e3041a1b663407dc61d8.tar.gz bcm5719-llvm-3d5a7d6b65ab7e19cd84e3041a1b663407dc61d8.zip |
clang-format: [Proto] Don't do bad things if imports are missing ;.
llvm-svn: 273179
Diffstat (limited to 'clang/unittests/Format/FormatTestProto.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestProto.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestProto.cpp b/clang/unittests/Format/FormatTestProto.cpp index d3d3d42aa84..68d724981ce 100644 --- a/clang/unittests/Format/FormatTestProto.cpp +++ b/clang/unittests/Format/FormatTestProto.cpp @@ -189,5 +189,20 @@ TEST_F(FormatTestProto, ExtendingMessage) { "}"); } +TEST_F(FormatTestProto, FormatsImports) { + verifyFormat("import \"a.proto\";\n" + "import \"b.proto\";\n" + "// comment\n" + "message A {\n" + "}"); + + // Missing semicolons should not confuse clang-format. + verifyFormat("import \"a.proto\"\n" + "import \"b.proto\"\n" + "// comment\n" + "message A {\n" + "}"); +} + } // end namespace tooling } // end namespace clang |