@@ -659,7 +659,50 @@ class MergeActionTests: XCTestCase {
659
659
" doc://org.swift.test/documentation/second.json " ,
660
660
] )
661
661
}
662
-
662
+
663
+ func testSingleReferenceOnlyArchiveMerging( ) async throws {
664
+ let fileSystem = try TestFileSystem (
665
+ folders: [
666
+ Folder ( name: " Output.doccarchive " , content: [ ] ) ,
667
+ Self . makeArchive (
668
+ name: " First " ,
669
+ documentationPages: [
670
+ " First " ,
671
+ " First/SomeClass " ,
672
+ " First/SomeClass/someProperty " ,
673
+ " First/SomeClass/someFunction(:_) " ,
674
+ ] ,
675
+ tutorialPages: [ ]
676
+ ) ,
677
+ ]
678
+ )
679
+
680
+ let logStorage = LogHandle . LogStorage ( )
681
+ let action = MergeAction (
682
+ archives: [
683
+ URL ( fileURLWithPath: " /First.doccarchive " ) ,
684
+ ] ,
685
+ landingPageInfo: testLandingPageInfo,
686
+ outputURL: URL ( fileURLWithPath: " /Output.doccarchive " ) ,
687
+ fileManager: fileSystem
688
+ )
689
+
690
+ _ = try await action. perform ( logHandle: . memory( logStorage) )
691
+ XCTAssertEqual ( logStorage. text, " " , " The action didn't log anything " )
692
+
693
+ let synthesizedRootNode = try fileSystem. renderNode ( atPath: " /Output.doccarchive/data/documentation.json " )
694
+ XCTAssertEqual ( synthesizedRootNode. metadata. title, " Test Landing Page Name " )
695
+ XCTAssertEqual ( synthesizedRootNode. metadata. roleHeading, " Test Landing Page Kind " )
696
+ XCTAssertEqual ( synthesizedRootNode. topicSectionsStyle, . detailedGrid)
697
+ XCTAssertEqual ( synthesizedRootNode. topicSections. flatMap { [ $0 . title ] . compactMap ( { $0 } ) + $0. identifiers } , [
698
+ // No title
699
+ " doc://org.swift.test/documentation/first.json " ,
700
+ ] )
701
+ XCTAssertEqual ( synthesizedRootNode. references. keys. sorted ( ) , [
702
+ " doc://org.swift.test/documentation/first.json " ,
703
+ ] )
704
+ }
705
+
663
706
func testErrorWhenArchivesContainOverlappingData( ) async throws {
664
707
let fileSystem = try TestFileSystem (
665
708
folders: [
0 commit comments