summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTestProto.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2016-06-20 18:20:38 +0000
committerDaniel Jasper <djasper@google.com>2016-06-20 18:20:38 +0000
commit3d5a7d6b65ab7e19cd84e3041a1b663407dc61d8 (patch)
treeb70af72774c66f09d71a18982136a3244a2b15e2 /clang/unittests/Format/FormatTestProto.cpp
parent4deb4ed21eda7d5e4fc3371a014249a36d7787b2 (diff)
downloadbcm5719-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.cpp15
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
OpenPOWER on IntegriCloud