Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[ios, macos] Updated documented default style version
Browse files Browse the repository at this point in the history
MGLStyleDefaultVersion is just for Streets now. Deleted style version documentation tests because not all styles are on the same version.
  • Loading branch information
1ec5 committed May 12, 2017
1 parent ed54849 commit ca97dd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
12 changes: 6 additions & 6 deletions platform/darwin/src/MGLStyle.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
NS_ASSUME_NONNULL_BEGIN

/**
A version number identifying the default version of the suite of default styles
provided by Mapbox. This version number may be passed into one of the
“StyleURLWithVersion” class methods of MGLStyle.
A version number identifying the default version of the Mapbox Streets style
obtained through the `-streetsStyleURL` method. This version number may also be
passed into the `-streetsStyleURLWithVersion:` method.
The value of this constant generally corresponds to the latest released version
as of the date on which this SDK was published. You can use this constant to
Expand Down Expand Up @@ -72,7 +72,7 @@ MGL_EXPORT
is specified explicitly.
@param version The style’s latest released version. As of publication, the
current version is `9`.
current version is `10`.
*/
+ (NSURL *)streetsStyleURLWithVersion:(NSInteger)version;

Expand All @@ -91,7 +91,7 @@ MGL_EXPORT
Outdoors is a general-purpose style tailored to outdoor activities.
@param version The style’s latest released version. As of publication, the
current version is `9`.
current version is `10`.
*/
+ (NSURL *)outdoorsStyleURLWithVersion:(NSInteger)version;

Expand Down Expand Up @@ -173,7 +173,7 @@ MGL_EXPORT
Streets.
@param version The style’s latest released version. As of publication, the
current version is `9`.
current version is `10`.
*/
+ (NSURL *)satelliteStreetsStyleURLWithVersion:(NSInteger)version;

Expand Down
13 changes: 0 additions & 13 deletions platform/darwin/test/MGLStyleTests.mm
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,6 @@ - (void)testStyleURLDeclarations {
XCTAssertNil(versionedMethodError, @"Error compiling regular expression to search for versioned methods.");
NSUInteger numVersionedMethodDeclarations = [versionedMethodExpression numberOfMatchesInString:styleHeader options:0 range:NSMakeRange(0, styleHeader.length)];
XCTAssertEqual(numVersionedMethodDeclarations, numVersionedMethods);

// Test that “current version is” statements are present and current for all versioned style methods.
NSError *versionError;
NSString *versionExpressionString = @(R"RE(current version is `(\d+)`)RE");
NSRegularExpression *versionExpression = [NSRegularExpression regularExpressionWithPattern:versionExpressionString options:0 error:&versionError];
XCTAssertNil(versionError, @"Error compiling regular expression to search for current version statements.");
NSUInteger numVersionDeclarations = [versionExpression numberOfMatchesInString:styleHeader options:0 range:NSMakeRange(0, styleHeader.length)];
XCTAssertEqual(numVersionDeclarations, numVersionedMethods);
[versionExpression enumerateMatchesInString:styleHeader options:0 range:NSMakeRange(0, styleHeader.length) usingBlock:^(NSTextCheckingResult * _Nullable result, NSMatchingFlags flags, BOOL * _Nonnull stop) {
XCTAssertEqual(result.numberOfRanges, 2, @"Regular expression should have one capture group.");
NSString *version = [styleHeader substringWithRange:[result rangeAtIndex:1]];
XCTAssertEqual([version integerValue], MGLStyleDefaultVersion, @"Versioned style URL method should document current version as %ld, not %ld.", MGLStyleDefaultVersion, version.integerValue);
}];
}

- (void)testName {
Expand Down

0 comments on commit ca97dd8

Please sign in to comment.