@@ -19,8 +19,6 @@ let testBundleIdentifier = "org.swift.docc.example"
1919
2020class NavigatorIndexingTests : XCTestCase {
2121
22- let iPadOSPlatformName = Platform . Name ( " iPadOS " , id: 6 )
23-
2422 struct Language : OptionSet {
2523 let rawValue : UInt8
2624
433431 let navigatorIndex = builder. navigatorIndex!
434432 XCTAssertEqual (
435433 navigatorIndex. availabilityIndex. platforms,
436- [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, iPadOSPlatformName ]
434+ [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, . iPadOS ]
437435 )
438436 XCTAssertEqual ( navigatorIndex. availabilityIndex. versions ( for: . iOS) , Set ( [
439437 Platform . Version ( string: " 13.0 " ) !,
817815
818816 let navigatorIndex = builder. navigatorIndex!
819817
820- XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, iPadOSPlatformName ] )
818+ XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, . iPadOS ] )
821819 XCTAssertEqual ( navigatorIndex. availabilityIndex. versions ( for: . iOS) , Set ( [
822820 Platform . Version ( string: " 13.0 " ) !,
823821 Platform . Version ( string: " 10.15 " ) !,
867865 // Read the index back from disk
868866 let navigatorIndex = try NavigatorIndex . readNavigatorIndex ( url: targetURL)
869867
870- XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, iPadOSPlatformName ] )
868+ XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, . iPadOS ] )
871869 XCTAssertEqual ( navigatorIndex. availabilityIndex. versions ( for: . iOS) , Set ( [
872870 Platform . Version ( string: " 13.0 " ) !,
873871 Platform . Version ( string: " 10.15 " ) !,
905903 func testNavigatorIndexGenerationWithLanguageGrouping( ) throws {
906904 let navigatorIndex = try generatedNavigatorIndex ( for: " TestBundle " , bundleIdentifier: testBundleIdentifier)
907905
908- XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, iPadOSPlatformName ] )
906+ XCTAssertEqual ( navigatorIndex. availabilityIndex. platforms, [ . watchOS, . macCatalyst, . iOS, . tvOS, . macOS, . iPadOS ] )
909907 XCTAssertEqual ( navigatorIndex. availabilityIndex. versions ( for: . iOS) , Set ( [
910908 Platform . Version ( string: " 13.0 " ) !,
911909 Platform . Version ( string: " 10.15 " ) !,
@@ -1008,7 +1006,7 @@ Root
10081006
10091007 XCTAssertEqual ( navigatorIndex. pathHasher, . md5)
10101008 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 ] )
10121010 XCTAssertEqual ( navigatorIndex. availabilityIndex. versions ( for: . macOS) , Set ( [
10131011 Platform . Version ( string: " 10.9 " ) !,
10141012 Platform . Version ( string: " 10.10 " ) !,
@@ -1030,12 +1028,13 @@ Root
10301028 Platform . Version ( string: " 13.0 " ) !,
10311029 ] ) )
10321030 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 ] ) )
10341032 XCTAssertEqual ( navigatorIndex. availabilityIndex. platform ( named: " macOS " ) , . macOS)
10351033 XCTAssertEqual ( navigatorIndex. availabilityIndex. platform ( named: " watchOS " ) , . watchOS)
10361034 XCTAssertEqual ( navigatorIndex. availabilityIndex. platform ( named: " tvOS " ) , . tvOS)
10371035 XCTAssertEqual ( navigatorIndex. availabilityIndex. platform ( named: " ios " ) , . undefined, " Incorrect capitalization " )
10381036 XCTAssertEqual ( navigatorIndex. availabilityIndex. platform ( named: " iOS " ) , . iOS)
1037+ XCTAssertEqual ( navigatorIndex. availabilityIndex. platform ( named: " iPadOS " ) , . iPadOS)
10391038
10401039 // Check ID mapping
10411040 XCTAssertNotNil ( navigatorIndex. id ( for: " /documentation/sidekit/sideclass " , with: . swift) )
@@ -1078,6 +1077,9 @@ Root
10781077 XCTAssertFalse ( availabilityInfo. isAvailable ( on: Platform ( name: . iOS, version: Platform . Version ( string: " 10.0 " ) !) ) )
10791078 availabilityInfo = availabilities [ 1 ]
10801079 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 ]
10811083 XCTAssertTrue ( availabilityInfo. belongs ( to: . macCatalyst) )
10821084 XCTAssertTrue ( availabilityInfo. isAvailable ( on: Platform ( name: . macCatalyst, version: Platform . Version ( string: " 13.0 " ) !) ) )
10831085
0 commit comments