aboutsummaryrefslogtreecommitdiff
path: root/unittests/Format/FormatTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Format/FormatTest.cpp')
-rw-r--r--unittests/Format/FormatTest.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp
index 668e8af76b..cba25fcf8f 100644
--- a/unittests/Format/FormatTest.cpp
+++ b/unittests/Format/FormatTest.cpp
@@ -1537,12 +1537,18 @@ TEST_F(FormatTest, FormatObjCMethodExpr) {
verifyFormat("throw [self errorFor:a];");
verifyFormat("@throw [self errorFor:a];");
- // The formatting of this isn't ideal yet. It tests that the formatter doesn't
- // break after "backing" but before ":", which would be at 80 columns.
+ // This tests that the formatter doesn't break after "backing" but before ":",
+ // which would be at 80 columns.
verifyFormat(
"void f() {\n"
- " if ((self = [super initWithContentRect:contentRect styleMask:\n"
- " styleMask backing:NSBackingStoreBuffered defer:YES]))");
+ " if ((self = [super initWithContentRect:contentRect styleMask:styleMask\n"
+ " backing:NSBackingStoreBuffered defer:YES]))");
+
+ verifyFormat("[foo setasdfasdffffffffffffadfasdfasdf:\n"
+ " [bar dowith:asdfdsfasdfasdfasfasfasfsafasdfsfad]];");
+
+ verifyFormat("[foo checkThatBreakingAfterColonWorksOk:\n"
+ " [bar ifItDoes:reduceOverallLineLengthLikeInThisCase]];");
}
@@ -1582,6 +1588,7 @@ TEST_F(FormatTest, ObjCAt) {
verifyFormat("@'c'");
verifyFormat("@true");
verifyFormat("NSNumber *smallestInt = @(-INT_MAX - 1);");
+ // FIXME: Array and dictionary literals need more work.
verifyFormat("@[");
verifyFormat("@{");