From 3d5a7d6b65ab7e19cd84e3041a1b663407dc61d8 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 20 Jun 2016 18:20:38 +0000 Subject: clang-format: [Proto] Don't do bad things if imports are missing ;. llvm-svn: 273179 --- clang/unittests/Format/FormatTestProto.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'clang/unittests/Format/FormatTestProto.cpp') 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 -- cgit v1.2.3