Skip to content

Commit dcd7c82

Browse files
authored
Merge pull request #944 from mamabusi/nslocale-branch
2 parents c08fe07 + ae7c8e9 commit dcd7c82

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Foundation/NSLocale.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ extension NSLocale {
9797
open class var availableLocaleIdentifiers: [String] {
9898
var identifiers = Array<String>()
9999
for obj in CFLocaleCopyAvailableLocaleIdentifiers()._nsObject {
100-
identifiers.append((obj as! NSString)._swiftObject)
100+
identifiers.append(obj as! String)
101101
}
102102
return identifiers
103103
}

TestFoundation/TestNSLocale.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class TestNSLocale : XCTestCase {
2020
return [
2121
("test_constants", test_constants),
2222
("test_Identifier", test_Identifier),
23-
("test_copy", test_copy)
23+
("test_copy", test_copy),
24+
("test_availableIdentifiers", test_availableIdentifiers),
2425
]
2526
}
2627

@@ -107,4 +108,8 @@ class TestNSLocale : XCTestCase {
107108

108109
XCTAssertTrue(locale == localeCopy)
109110
}
111+
112+
func test_availableIdentifiers() {
113+
XCTAssertNoThrow(Locale.availableIdentifiers)
114+
}
110115
}

0 commit comments

Comments
 (0)