summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-11-08 17:33:24 +0000
committerDaniel Jasper <djasper@google.com>2013-11-08 17:33:24 +0000
commit4478e5245e208e63d4fe7cdc218f7e9a7aa29978 (patch)
tree911b39c9fbdd118fa09164d5c625c335972c5a33 /clang/unittests/Format/FormatTest.cpp
parent09e604333e56396c88ed4b53dfdf4b2cb0d4370c (diff)
downloadbcm5719-llvm-4478e5245e208e63d4fe7cdc218f7e9a7aa29978.tar.gz
bcm5719-llvm-4478e5245e208e63d4fe7cdc218f7e9a7aa29978.zip
clang-format: Improve linebreaking and indentation for ObjC calls.
Before: popup_wdow_.reset([[RenderWidgetPopupWindow alloc] iniithContentRect: NSMakRet(origin_global.x, origin_global.y, pos.width(), pos.height()) syeMask:NSBorderlessWindowMask bking:NSBackingStoreBuffered der:NO]); [self param:function( // parameter)] After: popup_wdow_.reset([[RenderWidgetPopupWindow alloc] iniithContentRect:NSMakRet(origin_global.x, origin_global.y, pos.width(), pos.height()) syeMask:NSBorderlessWindowMask bking:NSBackingStoreBuffered der:NO]); [self param:function( // parameter)] llvm-svn: 194267
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r--clang/unittests/Format/FormatTest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 776bf49a4aa..7e4131bd686 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -5432,6 +5432,16 @@ TEST_F(FormatTest, FormatObjCMethodExpr) {
" backing:NSBackingStoreBuffered\n"
" defer:NO]);\n"
"}");
+ verifyFormat(
+ "void f() {\n"
+ " popup_wdow_.reset([[RenderWidgetPopupWindow alloc]\n"
+ " iniithContentRect:NSMakRet(origin_global.x, origin_global.y,\n"
+ " pos.width(), pos.height())\n"
+ " syeMask:NSBorderlessWindowMask\n"
+ " bking:NSBackingStoreBuffered\n"
+ " der:NO]);\n"
+ "}",
+ getLLVMStyleWithColumns(70));
verifyFormat("[contentsContainer replaceSubview:[subviews objectAtIndex:0]\n"
" with:contentsNativeView];");
@@ -5462,6 +5472,8 @@ TEST_F(FormatTest, FormatObjCMethodExpr) {
" aaaaaaaaaa:bbbbbbbbbbbbbbbbb\n"
" aaaaa:bbbbbbbbbbb + bbbbbbbbbbbb\n"
" aaaa:bbb];");
+ verifyFormat("[self param:function( //\n"
+ " parameter)]");
verifyFormat(
"[self aaaaaaaaaa:aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa |\n"
" aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa | aaaaaaaaaaaaaaa |\n"
OpenPOWER on IntegriCloud