@@ -19,8 +19,6 @@ let testBundleIdentifier = "org.swift.docc.example"
19
19
20
20
class NavigatorIndexingTests : XCTestCase {
21
21
22
- let iPadOSPlatformName = Platform . Name ( " iPadOS " , id: 6 )
23
-
24
22
struct Language : OptionSet {
25
23
let rawValue : UInt8
26
24
433
431
let navigatorIndex = builder. navigatorIndex!
434
432
XCTAssertEqual (
435
433
navigatorIndex. availabilityIndex. platforms,
436
- [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, iPadOSPlatformName ]
434
+ [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, . iPadOS ]
437
435
)
438
436
XCTAssertEqual ( navigatorIndex. availabilityIndex. versions ( for: . iOS) , Set ( [
439
437
Platform . Version ( string: " 13.0 " ) !,
817
815
818
816
let navigatorIndex = builder. navigatorIndex!
819
817
820
- XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, iPadOSPlatformName ] )
818
+ XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, . iPadOS ] )
821
819
XCTAssertEqual ( navigatorIndex. availabilityIndex. versions ( for: . iOS) , Set ( [
822
820
Platform . Version ( string: " 13.0 " ) !,
823
821
Platform . Version ( string: " 10.15 " ) !,
867
865
// Read the index back from disk
868
866
let navigatorIndex = try NavigatorIndex . readNavigatorIndex ( url: targetURL)
869
867
870
- XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, iPadOSPlatformName ] )
868
+ XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, . iPadOS ] )
871
869
XCTAssertEqual ( navigatorIndex. availabilityIndex. versions ( for: . iOS) , Set ( [
872
870
Platform . Version ( string: " 13.0 " ) !,
873
871
Platform . Version ( string: " 10.15 " ) !,
905
903
func testNavigatorIndexGenerationWithLanguageGrouping( ) throws {
906
904
let navigatorIndex = try generatedNavigatorIndex ( for: " TestBundle " , bundleIdentifier: testBundleIdentifier)
907
905
908
- XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, iPadOSPlatformName ] )
906
+ XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, . iPadOS ] )
909
907
XCTAssertEqual ( navigatorIndex. availabilityIndex. versions ( for: . iOS) , Set ( [
910
908
Platform . Version ( string: " 13.0 " ) !,
911
909
Platform . Version ( string: " 10.15 " ) !,
@@ -1008,7 +1006,7 @@ Root
1008
1006
1009
1007
XCTAssertEqual ( navigatorIndex. pathHasher, . md5)
1010
1008
XCTAssertEqual ( navigatorIndex. bundleIdentifier, testBundleIdentifier)
1011
- XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . iOS, . macCatalyst, . tvOS, . macOS, iPadOSPlatformName ] )
1009
+ XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . iOS, . macCatalyst, . tvOS, . macOS, . iPadOS ] )
1012
1010
XCTAssertEqual ( navigatorIndex. availabilityIndex. versions ( for: . macOS) , Set ( [
1013
1011
Platform . Version ( string: " 10.9 " ) !,
1014
1012
Platform . Version ( string: " 10.10 " ) !,
@@ -1030,12 +1028,13 @@ Root
1030
1028
Platform . Version ( string: " 13.0 " ) !,
1031
1029
] ) )
1032
1030
XCTAssertEqual ( Set ( navigatorIndex. languages) , Set ( [ " Swift " ] ) )
1033
- XCTAssertEqual ( Set ( navigatorIndex. availabilityIndex. platforms ( for: InterfaceLanguage . swift) ?? [ ] ) , Set ( [ . watchOS, . iOS, . macCatalyst, . tvOS, . macOS, iPadOSPlatformName ] ) )
1031
+ XCTAssertEqual ( Set ( navigatorIndex. availabilityIndex. platforms ( for: InterfaceLanguage . swift) ?? [ ] ) , Set ( [ . watchOS, . iOS, . macCatalyst, . tvOS, . macOS, . iPadOS ] ) )
1034
1032
XCTAssertEqual ( navigatorIndex. availabilityIndex. platform ( named: " macOS " ) , . macOS)
1035
1033
XCTAssertEqual ( navigatorIndex. availabilityIndex. platform ( named: " watchOS " ) , . watchOS)
1036
1034
XCTAssertEqual ( navigatorIndex. availabilityIndex. platform ( named: " tvOS " ) , . tvOS)
1037
1035
XCTAssertEqual ( navigatorIndex. availabilityIndex. platform ( named: " ios " ) , . undefined, " Incorrect capitalization " )
1038
1036
XCTAssertEqual ( navigatorIndex. availabilityIndex. platform ( named: " iOS " ) , . iOS)
1037
+ XCTAssertEqual ( navigatorIndex. availabilityIndex. platform ( named: " iPadOS " ) , . iPadOS)
1039
1038
1040
1039
// Check ID mapping
1041
1040
XCTAssertNotNil ( navigatorIndex. id ( for: " /documentation/sidekit/sideclass " , with: . swift) )
@@ -1078,6 +1077,9 @@ Root
1078
1077
XCTAssertFalse ( availabilityInfo. isAvailable ( on: Platform ( name: . iOS, version: Platform . Version ( string: " 10.0 " ) !) ) )
1079
1078
availabilityInfo = availabilities [ 1 ]
1080
1079
XCTAssertFalse ( availabilityInfo. belongs ( to: . macOS) )
1080
+ XCTAssertTrue ( availabilityInfo. belongs ( to: . iPadOS) )
1081
+ XCTAssertTrue ( availabilityInfo. isAvailable ( on: Platform ( name: . iPadOS, version: Platform . Version ( string: " 10.15.0 " ) !) ) )
1082
+ availabilityInfo = availabilities [ 2 ]
1081
1083
XCTAssertTrue ( availabilityInfo. belongs ( to: . macCatalyst) )
1082
1084
XCTAssertTrue ( availabilityInfo. isAvailable ( on: Platform ( name: . macCatalyst, version: Platform . Version ( string: " 13.0 " ) !) ) )
1083
1085
0 commit comments