aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-16 07:02:34 +0000
committerDaniel Jasper <djasper@google.com>2013-01-16 07:02:34 +0000
commit55b08e769f05987942c307fde8eb168df01e504f (patch)
treea97d048468c9595791183857f27a9381685ea861 /unittests/Format/FormatTest.cpp
parent05a10ff30bd7c93f689c002963e6ba536e83904a (diff)
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
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index eb00d017ff..ac61af3bfa 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -145,7 +145,17 @@ TEST_F(FormatTest, FormatIfWithoutCompountStatement) {
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) {