aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-10-30 14:04:10 +0000
committerDaniel Jasper <djasper@google.com>2013-10-30 14:04:10 +0000
commitdc837b1722d8e071d9ec0434aea487dbdfd57853 (patch)
tree0acb924f3eb9dc494f88892398f27c42a1673aa8 /unittests/Format
parent8437957c9da906c24d4e385869c05d8e601c664d (diff)
downloadclang-dc837b1722d8e071d9ec0434aea487dbdfd57853.tar.gz
clang-format: Fix indenting corner case with comment and else.
Before: if (a) { f(); } // or else .. else { g(); } After: if (a) { f(); } // or else .. else { g(); } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193684 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format')
-rw-r--r--unittests/Format/FormatTest.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 639b8c89d9..5852d1c0ed 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -374,6 +374,13 @@ TEST_F(FormatTest, ElseIf) {
" g();\n"
"else\n"
" h();");
+ verifyFormat("if (a) {\n"
+ " f();\n"
+ "}\n"
+ "// or else ..\n"
+ "else {\n"
+ " g()\n"
+ "}");
}
TEST_F(FormatTest, FormatsForLoop) {