diff options
| author | Daniel Jasper <djasper@google.com> | 2014-05-26 07:24:34 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2014-05-26 07:24:34 +0000 |
| commit | ba1b6bb667df50c54d903b815e5ba26118231d27 (patch) | |
| tree | 66b1bf28f1cca1482a65d7b7d0c0450249ae4aa3 /clang/unittests/Format/FormatTest.cpp | |
| parent | 10743a9e6d585b0b08ca01b55d99e9c7513f769c (diff) | |
| download | bcm5719-llvm-ba1b6bb667df50c54d903b815e5ba26118231d27.tar.gz bcm5719-llvm-ba1b6bb667df50c54d903b815e5ba26118231d27.zip | |
clang-format: Keep '{' of dict literals on the same line in Allman style
Before:
void f()
{
[object
someMethod:@
{ @"a" : @"b" }];
}
After:
void f()
{
[object someMethod:@{ @"a" : @"b" }];
}
This fixes llvm.org/PR19854.
llvm-svn: 209615
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 9cf4efcbf1f..94d4bbb00ef 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -7698,15 +7698,23 @@ TEST_F(FormatTest, AllmanBraceBreaking) { "#endif", BreakBeforeBrace); - // This shouldn't affect ObjC blocks. + // This shouldn't affect ObjC blocks.. verifyFormat("[self doSomeThingWithACompletionHandler:^{\n" " // ...\n" " int i;\n" - "}];"); + "}];", + BreakBeforeBrace); verifyFormat("void (^block)(void) = ^{\n" " // ...\n" " int i;\n" - "};"); + "};", + BreakBeforeBrace); + // .. or dict literals. + verifyFormat("void f()\n" + "{\n" + " [object someMethod:@{ @\"a\" : @\"b\" }];\n" + "}", + BreakBeforeBrace); BreakBeforeBrace.ColumnLimit = 19; verifyFormat("void f() { int i; }", BreakBeforeBrace); |

