File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
Sources/FoundationInternationalization/Locale
Tests/FoundationInternationalizationTests Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -417,7 +417,11 @@ extension Locale.Region {
417417
418418 /// An array of the sub-regions, matching the specified category of the region.
419419 @available ( FoundationPreview 6 . 2 , * )
420- public func subRegions( ofCategoy category: Category ) -> [ Locale . Region ] {
420+ #if FOUNDATION_FRAMEWORK
421+ // Renamed in 6.2.1
422+ @abi ( func subRegions( ofCategoy category: Category) -> [ Locale . Region] )
423+ #endif
424+ public func subRegions( ofCategory category: Category ) -> [ Locale . Region ] {
421425 var status = U_ZERO_ERROR
422426 let icuRegion = uregion_getRegionFromCode ( identifier, & status)
423427 guard let icuRegion, status. isSuccess else {
Original file line number Diff line number Diff line change @@ -43,14 +43,14 @@ struct LocaleRegionTests {
4343 }
4444
4545 @Test func subRegionOfCategory( ) async throws {
46- #expect( Locale . Region. unknown. subRegions ( ofCategoy : . world) == [ ] )
47- #expect( Locale . Region. unknown. subRegions ( ofCategoy : . territory) == [ ] )
46+ #expect( Locale . Region. unknown. subRegions ( ofCategory : . world) == [ ] )
47+ #expect( Locale . Region. unknown. subRegions ( ofCategory : . territory) == [ ] )
4848
49- #expect( Set ( Locale . Region. world. subRegions ( ofCategoy : . continent) ) == Set ( Locale . Region. isoRegions ( ofCategory: . continent) ) )
49+ #expect( Set ( Locale . Region. world. subRegions ( ofCategory : . continent) ) == Set ( Locale . Region. isoRegions ( ofCategory: . continent) ) )
5050
51- #expect( Locale . Region. argentina. subRegions ( ofCategoy : . continent) == [ ] )
52- #expect( Locale . Region. argentina. subRegions ( ofCategoy : . territory) == Locale . Region. argentina. subRegions)
51+ #expect( Locale . Region. argentina. subRegions ( ofCategory : . continent) == [ ] )
52+ #expect( Locale . Region. argentina. subRegions ( ofCategory : . territory) == Locale . Region. argentina. subRegions)
5353
54- #expect( Locale . Region ( " not a region " ) . subRegions ( ofCategoy : . territory) == [ ] )
54+ #expect( Locale . Region ( " not a region " ) . subRegions ( ofCategory : . territory) == [ ] )
5555 }
5656}
You can’t perform that action at this time.
0 commit comments