diff options
| author | Ben Hamilton <benhamilton@google.com> | 2018-02-06 18:01:47 +0000 |
|---|---|---|
| committer | Ben Hamilton <benhamilton@google.com> | 2018-02-06 18:01:47 +0000 |
| commit | 56d1c019992e5e020b3002289c55c89014b8c5d9 (patch) | |
| tree | d40da0cd5be96671397db1d20526d8d97b39e18f /clang/unittests/Format/FormatTestObjC.cpp | |
| parent | 0c904861e697ce3ffc3b41afb4d5fd96cce3e891 (diff) | |
| download | bcm5719-llvm-56d1c019992e5e020b3002289c55c89014b8c5d9.tar.gz bcm5719-llvm-56d1c019992e5e020b3002289c55c89014b8c5d9.zip | |
[clang-format] Add more tests for Objective-C 2.0 generic alignment
Summary:
In r236412, @djasper added a comment:
// FIXME: We likely want to do this for more combinations of brackets.
// Verify that it is wanted for ObjC, too.
In D42650, @stephanemoore asked me to confirm this.
This followup to D42650 adds more tests to verify the relative
alignment behavior for Objective-C 2.0 generics passed to functions
and removes the second half of the FIXME comment.
Test Plan:
make -j12 FormatTests && \
./tools/clang/unittests/Format/FormatTests --gtest_filter=FormatTestObjC.\*
Reviewers: stephanemoore, jolesiak, djasper
Reviewed By: jolesiak
Subscribers: klimek, cfe-commits, djasper, stephanemoore, krasimir
Differential Revision: https://reviews.llvm.org/D42864
llvm-svn: 324364
Diffstat (limited to 'clang/unittests/Format/FormatTestObjC.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTestObjC.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestObjC.cpp b/clang/unittests/Format/FormatTestObjC.cpp index d9805859f66..16a4390203c 100644 --- a/clang/unittests/Format/FormatTestObjC.cpp +++ b/clang/unittests/Format/FormatTestObjC.cpp @@ -189,6 +189,17 @@ TEST_F(FormatTestObjC, FormatObjCAutoreleasepool) { "}\n"); } +TEST_F(FormatTestObjC, FormatObjCGenerics) { + Style.ColumnLimit = 40; + verifyFormat("int aaaaaaaaaaaaaaaa(\n" + " NSArray<aaaaaaaaaaaaaaaaaa *>\n" + " aaaaaaaaaaaaaaaaa);\n"); + verifyFormat("int aaaaaaaaaaaaaaaa(\n" + " NSArray<aaaaaaaaaaaaaaaaaaa<\n" + " aaaaaaaaaaaaaaaa *> *>\n" + " aaaaaaaaaaaaaaaaa);\n"); +} + TEST_F(FormatTestObjC, FormatObjCInterface) { verifyFormat("@interface Foo : NSObject <NSSomeDelegate> {\n" "@public\n" |

