diff options
author | Thomas Van Lenten <thomasvl@google.com> | 2016-03-08 09:29:49 -0500 |
---|---|---|
committer | Thomas Van Lenten <thomasvl@google.com> | 2016-03-08 09:29:49 -0500 |
commit | 1bf4b38f29d6cc3f24ad1e0b6c3339420bd719be (patch) | |
tree | 5490ef3898bcef4f43f53a45d255bcd611da341f /objectivec/Tests/GPBMessageTests.m | |
parent | 3dd323818911a486bc62d172988aa23f68e64a7c (diff) | |
download | protobuf-1bf4b38f29d6cc3f24ad1e0b6c3339420bd719be.tar.gz protobuf-1bf4b38f29d6cc3f24ad1e0b6c3339420bd719be.tar.bz2 protobuf-1bf4b38f29d6cc3f24ad1e0b6c3339420bd719be.zip |
Fix up handing of fields with leading names that should be all caps.
Add a compile test to confirm things are working as expected.
Diffstat (limited to 'objectivec/Tests/GPBMessageTests.m')
-rw-r--r-- | objectivec/Tests/GPBMessageTests.m | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/objectivec/Tests/GPBMessageTests.m b/objectivec/Tests/GPBMessageTests.m index 7b37ca95..43546156 100644 --- a/objectivec/Tests/GPBMessageTests.m +++ b/objectivec/Tests/GPBMessageTests.m @@ -1820,6 +1820,24 @@ XCTAssertEqualObjects(enumDescriptor, expectedDescriptor); } +- (void)testPropertyNaming { + // objectivec_helpers.cc has some special handing to get proper all caps + // for a few cases to meet objc developer expectations. + // + // This "test" confirms that the expected names are generated, otherwise the + // test itself will fail to compile. + ObjCPropertyNaming *msg = [ObjCPropertyNaming message]; + // On their own, at the end, in the middle. + msg.URL = @"good"; + msg.thumbnailURL = @"good"; + msg.URLFoo = @"good"; + msg.someURLBlah = @"good"; + msg.HTTP = @"good"; + msg.HTTPS = @"good"; + // No caps since it was "urls". + [msg.urlsArray addObject:@"good"]; +} + - (void)testEnumNaming { // objectivec_helpers.cc has some interesting cases to deal with in // EnumValueName/EnumValueShortName. Confirm that things generated as |