From 7084823f8ec4367019940b26245e01684b62c7e1 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Thu, 10 Jan 2013 21:30:42 +0000 Subject: Formatter: No spaces around '=' in @property lines. Before: @property(assign, getter = isEditable) BOOL editable; Now: @property(assign, getter=isEditable) BOOL editable; It'd be nice if some Apple person could let me know if spaces are preferred around '=' in @synthesize lines (see FIXME in the test). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172110 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/Format/FormatTest.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'unittests/Format/FormatTest.cpp') diff --git a/unittests/Format/FormatTest.cpp b/unittests/Format/FormatTest.cpp index 5844853e05..deb668d984 100644 --- a/unittests/Format/FormatTest.cpp +++ b/unittests/Format/FormatTest.cpp @@ -1430,7 +1430,6 @@ TEST_F(FormatTest, ObjCAt) { verifyFormat("@["); verifyFormat("@{"); - EXPECT_EQ("@interface", format("@ interface")); // The precise formatting of this doesn't matter, nobody writes code like @@ -1452,10 +1451,16 @@ TEST_F(FormatTest, ObjCSnippets) { verifyFormat("@synchronized(self) {\n" " f();\n" "}"); + + // FIXME: Some Apple code examples don't have spaces around '=' for + // @synthesize, decide if that's desired or not in LLVM style. Google style + // definitely wants spaces. verifyFormat("@synthesize dropArrowPosition = dropArrowPosition_;"); + verifyGoogleFormat("@synthesize dropArrowPosition = dropArrowPosition_;"); - // FIXME: "getter=bar" should not be surround by spaces in @property. verifyFormat("@property(assign, nonatomic) CGFloat hoverAlpha;"); + verifyFormat("@property(assign, getter=isEditable) BOOL editable;"); + verifyGoogleFormat("@property(assign, getter=isEditable) BOOL editable;"); } } // end namespace tooling -- cgit v1.2.3-18-g5258