diff options
author | Daniel Jasper <djasper@google.com> | 2014-10-16 08:38:51 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-10-16 08:38:51 +0000 |
commit | ea772b4df29c88ce44413b6935278b9eddc3ff5d (patch) | |
tree | 30e85df8039c79b077fa295a761f398d31367efc /clang/unittests/Format/FormatTest.cpp | |
parent | 9bc86593a26ff0168d2ddd0b6145c34555ed785a (diff) | |
download | bcm5719-llvm-ea772b4df29c88ce44413b6935278b9eddc3ff5d.tar.gz bcm5719-llvm-ea772b4df29c88ce44413b6935278b9eddc3ff5d.zip |
clang-format: [ObjC] Fix method expression detection.
Before:
return (a)[foo bar : baz];
After:
return (a)[foo bar:baz];
llvm-svn: 219919
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 758e5042262..b195df4291c 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -6461,6 +6461,7 @@ TEST_F(FormatTest, FormatObjCMethodDeclarations) { TEST_F(FormatTest, FormatObjCMethodExpr) { verifyFormat("[foo bar:baz];"); verifyFormat("return [foo bar:baz];"); + verifyFormat("return (a)[foo bar:baz];"); verifyFormat("f([foo bar:baz]);"); verifyFormat("f(2, [foo bar:baz]);"); verifyFormat("f(2, a ? b : c);"); @@ -9137,10 +9138,8 @@ TEST_F(FormatTest, FormatsBlocks) { verifyFormat("foo(^{ bar(); });"); verifyFormat("foo(a, ^{ bar(); });"); - // FIXME: Make whitespace formatting consistent. Ask a ObjC dev how - // it would ideally look. verifyFormat("[operation setCompletionBlock:^{ [self onOperationDone]; }];"); - verifyFormat("int i = {[operation setCompletionBlock : ^{ [self " + verifyFormat("int i = {[operation setCompletionBlock:^{ [self " "onOperationDone]; }]};"); verifyFormat("[operation setCompletionBlock:^(int *i) { f(); }];"); verifyFormat("int a = [operation block:^int(int *i) { return 1; }];"); |