diff options
author | Daniel Jasper <djasper@google.com> | 2013-02-03 18:07:15 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-02-03 18:07:15 +0000 |
commit | 6bd0232b4f58e7ad40f687b09b0eb897bcc3fd1e (patch) | |
tree | 63e1c15f006dc4a58aa2d2ba66af8bb3f4a5c8e4 /unittests/Format | |
parent | 4c494f4af76017e2bb389a3a96cbcdbb8973cf97 (diff) |
Fix bug in formatting of nested initializers.
We can now format:
SomeArrayOfSomeType a = { { { 1, 2, 3 } }, { { 1, 2, 3 } },
{ { 111111111111111111111111111111,
222222222222222222222222222222,
333333333333333333333333333333 } },
{ { 1, 2, 3 } }, { { 1, 2, 3 } } };
Before, we did strange things there.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174291 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index bffbbf5331..ef97df951a 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -693,6 +693,12 @@ TEST_F(FormatTest, NestedStaticInitializers) { " 222222222222222222222222222222,\n" " 333333333333333333333333333333 },\n" " { 1, 2, 3 }, { 1, 2, 3 } } };"); + verifyFormat( + "SomeArrayOfSomeType a = { { { 1, 2, 3 } }, { { 1, 2, 3 } },\n" + " { { 111111111111111111111111111111,\n" + " 222222222222222222222222222222,\n" + " 333333333333333333333333333333 } },\n" + " { { 1, 2, 3 } }, { { 1, 2, 3 } } };"); // FIXME: We might at some point want to handle this similar to parameter // lists, where we have an option to put each on a single line. |