diff options
author | Ben Hamilton <benhamilton@google.com> | 2018-01-29 20:01:49 +0000 |
---|---|---|
committer | Ben Hamilton <benhamilton@google.com> | 2018-01-29 20:01:49 +0000 |
commit | 5dd4018bfc2060f81da8e97fcf33c7771948a02e (patch) | |
tree | c648688dcb60c87df36dd1d1f4b645b7488b5390 | |
parent | fc7d56d9498c0f457126adf3230330dd5b9aca5b (diff) | |
download | bcm5719-llvm-5dd4018bfc2060f81da8e97fcf33c7771948a02e.tar.gz bcm5719-llvm-5dd4018bfc2060f81da8e97fcf33c7771948a02e.zip |
[clang-format] Add more tests for ObjC protocol list formatting behavior
Summary:
The existing unit tests in FormatTestObjC.cpp didn't fully cover
all the cases for protocol confirmance list formatting.
This extends the unit tests to more cases of protocol
conformance list formatting, especially how the behavior changes
when `BinPackParameters` changes from `true` (the default) to `false`.
Test Plan: make -j12 FormatTests && \
./tools/clang/unittests/Format/FormatTests --gtest_filter=FormatTestObjC.\*
Reviewers: krasimir, jolesiak, stephanemoore
Reviewed By: krasimir
Subscribers: benhamilton, klimek, cfe-commits, hokein, Wizard
Differential Revision: https://reviews.llvm.org/D42649
llvm-svn: 323684
-rw-r--r-- | clang/unittests/Format/FormatTestObjC.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestObjC.cpp b/clang/unittests/Format/FormatTestObjC.cpp index 879932db0db..23e90663717 100644 --- a/clang/unittests/Format/FormatTestObjC.cpp +++ b/clang/unittests/Format/FormatTestObjC.cpp @@ -276,6 +276,20 @@ TEST_F(FormatTestObjC, FormatObjCInterface) { "+ (id)init;\n" "@end"); + Style.ColumnLimit = 40; + verifyFormat("@interface ccccccccccccc () <\n" + " ccccccccccccc, ccccccccccccc,\n" + " ccccccccccccc, ccccccccccccc> {\n" + "}"); + + Style.BinPackParameters = false; + verifyFormat("@interface ddddddddddddd () <\n" + " ddddddddddddd,\n" + " ddddddddddddd,\n" + " ddddddddddddd,\n" + " ddddddddddddd> {\n" + "}"); + Style = getGoogleStyle(FormatStyle::LK_ObjC); verifyFormat("@interface Foo : NSObject <NSSomeDelegate> {\n" " @public\n" |