diff options
| author | Daniel Jasper <djasper@google.com> | 2014-01-30 14:38:37 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2014-01-30 14:38:37 +0000 |
| commit | a88f80a1bee417216b13cf133f56826150df9ef5 (patch) | |
| tree | cc12cc17f748aed1b24a0483050ae58782bf3178 /clang/unittests | |
| parent | 3f6af151df0b971bb0f0f2b20e15dc7cee11ac72 (diff) | |
| download | bcm5719-llvm-a88f80a1bee417216b13cf133f56826150df9ef5.tar.gz bcm5719-llvm-a88f80a1bee417216b13cf133f56826150df9ef5.zip | |
clang-format: Support ObjC's NS_ENUMs.
Before:
typedef NS_ENUM(NSInteger, MyType) {
/// Information about someDecentlyLongValue.
someDecentlyLongValue,
/// Information about anotherDecentlyLongValue.
anotherDecentlyLongValue,
/// Information about aThirdDecentlyLongValue.
aThirdDecentlyLongValue};
After:
typedef NS_ENUM(NSInteger, MyType) {
/// Information about someDecentlyLongValue.
someDecentlyLongValue,
/// Information about anotherDecentlyLongValue.
anotherDecentlyLongValue,
/// Information about aThirdDecentlyLongValue.
aThirdDecentlyLongValue
};
llvm-svn: 200469
Diffstat (limited to 'clang/unittests')
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index 9b0a11c3bc2..93e3f7a5936 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -1713,6 +1713,18 @@ TEST_F(FormatTest, FormatsEnumTypes) { verifyFormat("enum X : std::uint32_t { A, B };"); } +TEST_F(FormatTest, FormatsNSEnums) { + verifyGoogleFormat("typedef NS_ENUM(NSInteger, SomeName) { AAA, BBB }"); + verifyGoogleFormat("typedef NS_ENUM(NSInteger, MyType) {\n" + " // Information about someDecentlyLongValue.\n" + " someDecentlyLongValue,\n" + " // Information about anotherDecentlyLongValue.\n" + " anotherDecentlyLongValue,\n" + " // Information about aThirdDecentlyLongValue.\n" + " aThirdDecentlyLongValue\n" + "};"); +} + TEST_F(FormatTest, FormatsBitfields) { verifyFormat("struct Bitfields {\n" " unsigned sClass : 8;\n" |

