[darwin] Add warning about certain tests requiring en_US locale

This commit is contained in:
Jason Wray
2019-06-12 15:33:27 -07:00
committed by Jason Wray
parent 22741891c1
commit 290a9fcad5
5 changed files with 21 additions and 3 deletions

View File

@@ -1,14 +1,17 @@
#import <Mapbox/Mapbox.h>
#import <XCTest/XCTest.h>
static NSString * const MGLTestLocaleIdentifier = @"en-US";
@interface MGLClockDirectionFormatterTests : XCTestCase
@end
@implementation MGLClockDirectionFormatterTests
- (void)setUp {
// FIXME: https://github.com/mapbox/mapbox-gl-native/issues/14908
XCTAssertEqualObjects(NSLocale.currentLocale.localeIdentifier, @"en_US", @"Device locale must be en_US for these tests to pass.");
}
- (void)testClockDirections {
MGLClockDirectionFormatter *shortFormatter = [[MGLClockDirectionFormatter alloc] init];
shortFormatter.unitStyle = NSFormattingUnitStyleShort;

View File

@@ -7,6 +7,11 @@
@implementation MGLCompassDirectionFormatterTests
- (void)setUp {
// FIXME: https://github.com/mapbox/mapbox-gl-native/issues/14908
XCTAssertEqualObjects(NSLocale.currentLocale.localeIdentifier, @"en_US", @"Device locale must be en_US for these tests to pass.");
}
- (void)testCompassDirections {
MGLCompassDirectionFormatter *shortFormatter = [[MGLCompassDirectionFormatter alloc] init];
shortFormatter.unitStyle = NSFormattingUnitStyleShort;

View File

@@ -7,6 +7,11 @@
@implementation MGLCoordinateFormatterTests
- (void)setUp {
// FIXME: https://github.com/mapbox/mapbox-gl-native/issues/14908
XCTAssertEqualObjects(NSLocale.currentLocale.localeIdentifier, @"en_US", @"Device locale must be en_US for these tests to pass.");
}
- (void)testStrings {
MGLCoordinateFormatter *shortFormatter = [[MGLCoordinateFormatter alloc] init];
shortFormatter.unitStyle = NSFormattingUnitStyleShort;

View File

@@ -9,7 +9,7 @@
@implementation MGLNSStringAdditionsTests
- (void)testTitleCasedString {
NSLocale *locale = [NSLocale currentLocale];
NSLocale *locale = [NSLocale localeWithLocaleIdentifier:@"en_US"];
XCTAssertEqualObjects([@"© OpenStreetMap" mgl_titleCasedStringWithLocale:locale], @"© OpenStreetMap");
XCTAssertEqualObjects([@"© OSM" mgl_titleCasedStringWithLocale:locale], @"© OSM");

View File

@@ -8,6 +8,11 @@
@implementation MGLMapAccessibilityElementTests
- (void)setUp {
// FIXME: https://github.com/mapbox/mapbox-gl-native/issues/14908
XCTAssertEqualObjects(NSLocale.currentLocale.localeIdentifier, @"en_US", @"Device locale must be en_US for these tests to pass.");
}
- (void)testFeatureLabels {
MGLPointFeature *feature = [[MGLPointFeature alloc] init];
feature.attributes = @{