aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2012-12-10 16:34:48 +0000
committerAlexander Kornienko <alexfh@google.com>2012-12-10 16:34:48 +0000
commit56e49c5cc2b05e805c7aa9dc53672711e540d58b (patch)
treefe9996f2d1929ef7b63dbb625c4ff98ad217e85a /unittests/Format/FormatTest.cpp
parent31bdf071afc18bb9551e4f4254be297333200c4a (diff)
Clang-format: error recovery for access specifiers
Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D198 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169738 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index d00da7ffee..79cefc4663 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -498,10 +498,26 @@ TEST_F(FormatTest, HandlesIncludeDirectives) {
// Error recovery tests.
//===----------------------------------------------------------------------===//
-//TEST_F(FormatTest, IncorrectDerivedClass) {
-// verifyFormat("public B {\n"
-// "};");
-//}
+TEST_F(FormatTest, IncorrectAccessSpecifier) {
+ verifyFormat("public:");
+ verifyFormat("class A {\n"
+ "public\n"
+ " void f() {\n"
+ " }\n"
+ "};");
+ verifyFormat("public\n"
+ "int qwerty;");
+ verifyFormat("public\n"
+ "B {\n"
+ "};");
+ verifyFormat("public\n"
+ "{\n"
+ "};");
+ verifyFormat("public\n"
+ "B {\n"
+ " int x;\n"
+ "};");
+}
TEST_F(FormatTest, IncorrectCodeUnbalancedBraces) {
verifyFormat("{");