diff --git a/platform/darwin/test/MGLNSStringAdditionsTests.m b/platform/darwin/test/MGLNSStringAdditionsTests.m index a3ee7e34335..c88e8690bc4 100644 --- a/platform/darwin/test/MGLNSStringAdditionsTests.m +++ b/platform/darwin/test/MGLNSStringAdditionsTests.m @@ -9,7 +9,7 @@ @interface MGLNSStringAdditionsTests : XCTestCase @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"); diff --git a/platform/darwin/test/MGLTileSetTests.mm b/platform/darwin/test/MGLTileSetTests.mm index 2319f664470..9a09a2bd09b 100644 --- a/platform/darwin/test/MGLTileSetTests.mm +++ b/platform/darwin/test/MGLTileSetTests.mm @@ -69,10 +69,11 @@ - (void)testTileSetFromTileURLTemplates { #if TARGET_OS_IPHONE UIColor *redColor = [UIColor redColor]; #else - // CSS uses the sRGB color space. In macOS 10.12 Sierra and below, - // -[NSColor redColor] is in the calibrated RGB space and has a slightly - // different sRGB value than on iOS and macOS 10.13 High Sierra. - NSColor *redColor = [NSColor colorWithSRGBRed:1 green:0 blue:0 alpha:1]; + // CSS uses the sRGB color space. + // AppKit incorrectly uses calibrated RGB when exporting HTML, so input + // calibrated RGB to ensure round-tripping. + // + NSColor *redColor = [NSColor colorWithCalibratedRed:1 green:0 blue:0 alpha:1]; #endif NSAttributedString *gl = [[NSAttributedString alloc] initWithString:@"GL" attributes:@{ NSBackgroundColorAttributeName: redColor,