diff options
author | Daniel Jasper <djasper@google.com> | 2013-02-26 13:18:08 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-02-26 13:18:08 +0000 |
commit | 84a1a63b034744b68a27ec171dca5b1b7cf303f0 (patch) | |
tree | afa57bce3022555cc553c38dd3f5cfa0ae7e7f5d /unittests/Format/FormatTest.cpp | |
parent | 1ef81d57fbcc26080c98e140e7c82db6d2aeba87 (diff) |
In range-based for-loops, prefer splitting after ":".
Before:
for (const aaaaaaaaaaaaaaaaaaaaa &
aaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}
After:
for (const aaaaaaaaaaaaaaaaaaaaa &aaaaaaaaa :
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176087 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 53f3773d5c..9e777c66e9 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -318,6 +318,8 @@ TEST_F(FormatTest, RangeBasedForLoops) { " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {\n}"); verifyFormat("for (auto aaaaaaaaaaaaaaaaaaaaa :\n" " aaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaa, aaaaaaaaaaaaa)) {\n}"); + verifyFormat("for (const aaaaaaaaaaaaaaaaaaaaa &aaaaaaaaa :\n" + " aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {\n}"); } TEST_F(FormatTest, FormatsWhileLoop) { @@ -601,10 +603,10 @@ TEST_F(FormatTest, CommentsInStaticInitializers) { " b\n" "}")); EXPECT_EQ("S s = { a, b };", format("S s = {\n" - " a,\n" - "\n" - " b\n" - "};")); + " a,\n" + "\n" + " b\n" + "};")); } //===----------------------------------------------------------------------===// |