diff options
author | Daniel Jasper <djasper@google.com> | 2014-01-16 19:14:34 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-01-16 19:14:34 +0000 |
commit | b889277f5fa21ad0d64b4aae0012779715446fb3 (patch) | |
tree | 341545d586c137cebff644b6615815f86e74bd47 /unittests/Format | |
parent | 619ef7e20cf8a88cfe498135d81bfe58672d59a1 (diff) | |
download | clang-b889277f5fa21ad0d64b4aae0012779715446fb3.tar.gz |
clang-format: Improve formatting of ObjC Blocks with return type.
Before:
int a = [operation block:^int(int * i) { return 1; }];
After:
int a = [operation block:^int(int *i) { return 1; }];
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@199411 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Format')
-rw-r--r-- | unittests/Format/FormatTest.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 910df45976..c75df9ce15 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -7907,6 +7907,10 @@ TEST_F(FormatTest, FormatsBlocks) { verifyFormat("int i = {[operation setCompletionBlock : ^{ [self " "onOperationDone]; }] };"); verifyFormat("[operation setCompletionBlock:^(int *i) { f(); }];"); + verifyFormat("int a = [operation block:^int(int *i) { return 1; }];"); + verifyFormat("[myObject doSomethingWith:arg1\n" + " aaa:^int(int *a) { return 1; }\n" + " bbb:f(a * b)];"); verifyFormat("[operation setCompletionBlock:^{\n" " [self.delegate newDataAvailable];\n" |