diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-12-16 08:09:42 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-16 08:09:42 -0800 |
commit | 3f26e88c49d3afeb3754a877b8473deb4bf2cded (patch) | |
tree | bc1dc3211623211302201d07219c46fdaf055487 /platform/darwin/src/MGLRuntimeStylingTests.m.ejs | |
parent | b8466946e5eac5a4359206c19fe6e659ae9cf6c1 (diff) | |
download | qtlocation-mapboxgl-3f26e88c49d3afeb3754a877b8473deb4bf2cded.tar.gz |
Use appropriate part of speech for properties (#7457)
* [ios, macos] Use appropriate part of speech for properties
Fixed overridden property references in requirements lists. Boolean-typed properties can now have getters beginning with “is”.
Renamed a number of layout properties according to the following rules: Boolean-typed properties should include a verb; other properties must be noun phrases; all properties must be grammatical.
* [ios, macos] Added style spec names as unavailable aliases
Renamed properties now have aliases based on their style specification names, marked unavailable, for wayfinding purposes.
* [ios, macos] Fixed autosynthesis warnings
* [ios, macos] Moved style layer test template to test folder
* [ios, macos] Customized iconOptional getter
* [ios, macos] Avoid autosynthesis of aliases
* [ios, macos] Test that property names are grammatical
Run property getter names through a basic battery of tests to see if they’re grammatical. Most part-of-speech tagging tests are guarded by a compile-time flag, off by default, because NSLinguisticTagger does a poor job of telling nouns from verbs, and we’ve intentionally kept many words in property names that could be read as either verbs or nouns (like “transform” or “scale”).
Diffstat (limited to 'platform/darwin/src/MGLRuntimeStylingTests.m.ejs')
-rw-r--r-- | platform/darwin/src/MGLRuntimeStylingTests.m.ejs | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/platform/darwin/src/MGLRuntimeStylingTests.m.ejs b/platform/darwin/src/MGLRuntimeStylingTests.m.ejs deleted file mode 100644 index 91c626d1a2..0000000000 --- a/platform/darwin/src/MGLRuntimeStylingTests.m.ejs +++ /dev/null @@ -1,59 +0,0 @@ -<% - const type = locals.type; - const layoutProperties = locals.layoutProperties; - const paintProperties = locals.paintProperties; --%> -// This file is generated. -// Edit platform/darwin/scripts/generate-style-code.js, then run `make style-code-darwin`. - -#import "MGLStyleLayerTests.h" - -@interface MGL<%- camelize(type) %>LayerTests : MGLStyleLayerTests -@end - -@implementation MGL<%- camelize(type) %>LayerTests - -- (void)test<%- camelize(type) %>Layer { -<% if (type === 'background') { -%> - MGL<%- camelize(type) %>StyleLayer *layer = [[MGL<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID"]; -<% } else { -%> - NSString *filePath = [[NSBundle bundleForClass:self.class] pathForResource:@"amsterdam" ofType:@"geojson"]; - NSURL *url = [NSURL fileURLWithPath:filePath]; - MGLShapeSource *source = [[MGLShapeSource alloc] initWithIdentifier:@"sourceID" URL:url options:nil]; - [self.mapView.style addSource:source]; - MGL<%- camelize(type) %>StyleLayer *layer = [[MGL<%- camelize(type) %>StyleLayer alloc] initWithIdentifier:@"layerID" source:source]; -<% } -%> - [self.mapView.style addLayer:layer]; - -<% for (const property of layoutProperties) { -%> - <%- testImplementation(property, type) %> -<% } -%> -<% for (const property of paintProperties) { -%> - <%- testImplementation(property, type) %> -<% } -%> - - MGL<%- camelize(type) %>StyleLayer *gLayer = (MGL<%- camelize(type) %>StyleLayer *)[self.mapView.style layerWithIdentifier:@"layerID"]; - XCTAssertTrue([gLayer isKindOfClass:[MGL<%- camelize(type) %>StyleLayer class]]); -<% for (const property of layoutProperties) { -%> - <%- testGetterImplementation(property, type) %> -<% } -%> -<% for (const property of paintProperties) { -%> - <%- testGetterImplementation(property, type) %> -<% } -%> - -<% for (const property of layoutProperties) { -%> - <%- testImplementation(property, type, true) %> -<% } -%> -<% for (const property of paintProperties) { -%> - <%- testImplementation(property, type, true) %> -<% } -%> - -<% for (const property of layoutProperties) { -%> - <%- testGetterImplementation(property, type, true) %> -<% } -%> -<% for (const property of paintProperties) { -%> - <%- testGetterImplementation(property, type, true) %> -<% } -%> -} - -@end |