diff options
author | Jason Wray <jason@mapbox.com> | 2018-01-09 16:09:41 -0500 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2018-01-10 17:26:11 -0500 |
commit | 0806e16eb390d9eb7db3157e23798f4010614aca (patch) | |
tree | e4e8a2d83ea49df8ec83b6d16e9f1c0b83a20140 /platform/ios/test | |
parent | c9da6e495900cfe927d1f571e1687b20e0543dbd (diff) | |
download | qtlocation-mapboxgl-0806e16eb390d9eb7db3157e23798f4010614aca.tar.gz |
[ios] Fix and expand accessibility feature transliteration
- Fixed pre-iOS 11 compatibility.
- Expanded transliteration to all supported languages.
Diffstat (limited to 'platform/ios/test')
-rw-r--r-- | platform/ios/test/MGLMapAccessibilityElementTests.m | 8 | ||||
-rw-r--r-- | platform/ios/test/MGLNSOrthographyAdditionsTests.m | 19 |
2 files changed, 25 insertions, 2 deletions
diff --git a/platform/ios/test/MGLMapAccessibilityElementTests.m b/platform/ios/test/MGLMapAccessibilityElementTests.m index 5c79d85de1..89a595421e 100644 --- a/platform/ios/test/MGLMapAccessibilityElementTests.m +++ b/platform/ios/test/MGLMapAccessibilityElementTests.m @@ -19,13 +19,17 @@ }; MGLFeatureAccessibilityElement *element = [[MGLFeatureAccessibilityElement alloc] initWithAccessibilityContainer:self feature:feature]; XCTAssertEqualObjects(element.accessibilityLabel, @"English", @"Accessibility label should be localized."); - + feature.attributes = @{ @"name": @"Цинциннати", @"name_en": @"Цинциннати", }; element = [[MGLFeatureAccessibilityElement alloc] initWithAccessibilityContainer:self feature:feature]; - XCTAssertEqualObjects(element.accessibilityLabel, @"Cincinnati", @"Accessibility label should be romanized."); + if (@available(iOS 9.0, *)) { + XCTAssertEqualObjects(element.accessibilityLabel, @"Cincinnati", @"Accessibility label should be romanized."); + } else { + XCTAssertEqualObjects(element.accessibilityLabel, @"Цинциннати", @"Accessibility label should not be romanized."); + } } - (void)testPlaceFeatureValues { diff --git a/platform/ios/test/MGLNSOrthographyAdditionsTests.m b/platform/ios/test/MGLNSOrthographyAdditionsTests.m new file mode 100644 index 0000000000..351fe4227e --- /dev/null +++ b/platform/ios/test/MGLNSOrthographyAdditionsTests.m @@ -0,0 +1,19 @@ +#import <XCTest/XCTest.h> + +#import "NSOrthography+MGLAdditions.h" +#import "MGLVectorSource_Private.h" + +@interface MGLNSOrthographyAdditionsTests : XCTestCase + +@end + +@implementation MGLNSOrthographyAdditionsTests + +- (void)testStreetsLanguages { + for (NSString *language in [MGLVectorSource mapboxStreetsLanguages]) { + NSString *dominantScript = [NSOrthography mgl_dominantScriptForMapboxStreetsLanguage:language]; + XCTAssertNotEqualObjects(dominantScript, @"Zyyy", @"Mapbox Streets languages should have dominant script"); + } +} + +@end |