Remove errors were if statements were incorrectly put on a single line.
Before: if (a) // This comment confused clang-format f();
After: if (a) // No more confusion
f();
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172600 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index eb00d01..ac61af3 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -145,7 +145,17 @@
verifyFormat("if (a) return;", getGoogleStyleWithColumns(14));
verifyFormat("if (a)\n return;", getGoogleStyleWithColumns(13));
verifyFormat("if (aaaaaaaaa)\n"
- " return;", getGoogleStyleWithColumns(14));
+ " return;", getGoogleStyleWithColumns(14));
+ verifyGoogleFormat("if (a) // Can't merge this\n"
+ " f();\n");
+ verifyGoogleFormat("if (a) /* still don't merge */\n"
+ " f();");
+ verifyGoogleFormat("if (a) { // Never merge this\n"
+ " f();\n"
+ "}");
+ verifyGoogleFormat("if (a) { /* Never merge this */\n"
+ " f();\n"
+ "}");
}
TEST_F(FormatTest, ParseIfElse) {