diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-16 07:02:34 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-16 07:02:34 +0000 |
commit | c36492b598e9cb710be2c053b15d9acc36a3168d (patch) | |
tree | 713280b5f17e17dc0aa5aff818d3a29f8c43158b /clang/unittests/Format/FormatTest.cpp | |
parent | 6a9355f8d7a2352a443499eaee3ac87fc41e1037 (diff) | |
download | bcm5719-llvm-c36492b598e9cb710be2c053b15d9acc36a3168d.tar.gz bcm5719-llvm-c36492b598e9cb710be2c053b15d9acc36a3168d.zip |
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();
llvm-svn: 172600
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index eb00d017ff3..ac61af3bfae 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/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) { |