diff options
author | Alexander Kornienko <alexfh@google.com> | 2012-12-04 15:40:36 +0000 |
---|---|---|
committer | Alexander Kornienko <alexfh@google.com> | 2012-12-04 15:40:36 +0000 |
commit | 393b008bcebb0a678a5a0a93ad69e28a30a62e84 (patch) | |
tree | 6ce2461bc3d02c5dc346ab2b70a20abdb4cd7fd3 /unittests/Format/FormatTest.cpp | |
parent | 02c1b863440b067f3d674bde237146ef54c17875 (diff) |
Clang-format error recovery part 1
Reviewers: klimek
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D163
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index e21367bb31..5c1b6031c6 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -363,5 +363,23 @@ TEST_F(FormatTest, HandlesIncludeDirectives) { // "};"); //} +TEST_F(FormatTest, IncorrectCodeUnbalancedBraces) { + verifyFormat("{"); +} + +TEST_F(FormatTest, IncorrectCodeDoNoWhile) { + verifyFormat("do {\n" + "};"); + verifyFormat("do {\n" + "};\n" + "f();"); + verifyFormat("do {\n" + "}\n" + "wheeee(fun);"); + verifyFormat("do {\n" + " f();\n" + "};"); +} + } // end namespace tooling } // end namespace clang |