diff options
author | Daniel Jasper <djasper@google.com> | 2015-05-13 09:38:25 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-05-13 09:38:25 +0000 |
commit | a2a4d9c049e23590b003d726ee8691a6628b8dfb (patch) | |
tree | bcc19516c47c3d49dc59bd5a9730f592b9994895 /clang/unittests/Format/FormatTest.cpp | |
parent | 4276cb3a50734aaa27b22a34dc6549b474ab46ea (diff) | |
download | bcm5719-llvm-a2a4d9c049e23590b003d726ee8691a6628b8dfb.tar.gz bcm5719-llvm-a2a4d9c049e23590b003d726ee8691a6628b8dfb.zip |
clang-format: [ObjC] Make IndentWrappedFunctionNames work with ObjC functions
llvm-svn: 237241
Diffstat (limited to 'clang/unittests/Format/FormatTest.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index ecd78b24d09..fbe651ef12a 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -6863,6 +6863,21 @@ TEST_F(FormatTest, FormatForObjectiveCMethodDecls) { " outRange8:(NSRange)out_range8\n" " outRange9:(NSRange)out_range9;"); + // When the function name has to be wrapped. + FormatStyle Style = getLLVMStyle(); + Style.IndentWrappedFunctionNames = false; + verifyFormat("- (SomeLooooooooooooooooooooongType *)\n" + "veryLooooooooooongName:(NSString)aaaaaaaaaaaaaa\n" + " anotherName:(NSString)bbbbbbbbbbbbbb {\n" + "}", + Style); + Style.IndentWrappedFunctionNames = true; + verifyFormat("- (SomeLooooooooooooooooooooongType *)\n" + " veryLooooooooooongName:(NSString)aaaaaaaaaaaaaa\n" + " anotherName:(NSString)bbbbbbbbbbbbbb {\n" + "}", + Style); + verifyFormat("- (int)sum:(vector<int>)numbers;"); verifyGoogleFormat("- (void)setDelegate:(id<Protocol>)delegate;"); // FIXME: In LLVM style, there should be a space in front of a '<' for ObjC |