Skip to content

Commit 25d5e47

Browse files
committed
Replace "sidecar" references with "documentation extension" in tests
Updates comments, local variable names, and one test method name to use the canonical "documentation extension" terminology already used throughout Sources/ rdar://67827882
1 parent 071af89 commit 25d5e47

5 files changed

Lines changed: 19 additions & 20 deletions

File tree

Tests/SwiftDocCTests/Infrastructure/AutomaticCurationTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class AutomaticCurationTests: XCTestCase {
149149
return section.identifiers.contains("doc://org.swift.docc.example/documentation/SideKit/SideClass/Element")
150150
}).isEmpty)
151151

152-
// Verify that element `SideKit/SideClass/path` curated in sidecar under `SideKit`
152+
// Verify that element `SideKit/SideClass/path` curated in a documentation extension under `SideKit`
153153
// is NOT automatically curated in `SideClass`'s "Topics"
154154
XCTAssertTrue(renderNode.topicSections.filter({ section -> Bool in
155155
return section.identifiers.contains("doc://org.swift.docc.example/documentation/SideKit/SideClass/path")
@@ -285,7 +285,7 @@ class AutomaticCurationTests: XCTestCase {
285285
graph.relationships.append(newRelationship)
286286
}
287287

288-
// Add a sidecar file for this symbol
288+
// Add a documentation extension file for this symbol
289289
try """
290290
# ``SideKit/SideClass\(suffix)``
291291

Tests/SwiftDocCTests/Infrastructure/DocumentationContext/DocumentationContextTests.swift

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -924,7 +924,7 @@ class DocumentationContextTests: XCTestCase {
924924
XCTAssertTrue(parent.path.hasSuffix("MyKit/MyClass"))
925925

926926
//
927-
// Test sidecar documentation
927+
// Test documentation extension
928928
//
929929

930930
// MyProtocol is loaded
@@ -2176,7 +2176,7 @@ let expected = """
21762176
XCTAssertNoThrow(try context.entity(with: ResolvedTopicReference(bundleID: "org.swift.docc.example", path: "/documentation/SideKit/sideClass-swift.var", sourceLanguage: .swift)))
21772177
}
21782178

2179-
func testUnresolvedSidecarDiagnostics() async throws {
2179+
func testUnresolvedDocumentationExtensionDiagnostics() async throws {
21802180
let catalog = Folder(name: "unit-test.docc", content: [
21812181
JSONFile(name: "ModuleName.symbols.json", content: makeSymbolGraph(
21822182
moduleName: "ModuleName",
@@ -2203,15 +2203,14 @@ let expected = """
22032203
let unmatchedDocExtensionDiagnostic = try XCTUnwrap(context.diagnostics.first(where: { $0.identifier == "org.swift.docc.SymbolUnmatched" }))
22042204
XCTAssertNotNil(unmatchedDocExtensionDiagnostic)
22052205

2206-
// Verify the diagnostics have the sidecar source URL
2206+
// Verify the diagnostics have the documentation extension source URL
22072207
let source = try XCTUnwrap(unmatchedDocExtensionDiagnostic.source)
2208-
2209-
let unmatchedSidecarDiagnostic = unmatchedDocExtensionDiagnostic
2208+
22102209
XCTAssertTrue(bundle.markupURLs.contains(source.standardizedFileURL), "One of the files should be the diagnostic source")
2211-
XCTAssertEqual(unmatchedSidecarDiagnostic.range, SourceLocation(line: 1, column: 3, source: unmatchedDocExtensionDiagnostic.source)..<SourceLocation(line: 1, column: 32, source: unmatchedDocExtensionDiagnostic.source))
2212-
2213-
XCTAssertEqual(unmatchedSidecarDiagnostic.summary, "No symbol matched '/ModuleName/UnknownSymbol'. 'UnknownSymbol' doesn't exist at '/ModuleName'.")
2214-
XCTAssertEqual(unmatchedSidecarDiagnostic.severity, .warning)
2210+
XCTAssertEqual(unmatchedDocExtensionDiagnostic.range, SourceLocation(line: 1, column: 3, source: unmatchedDocExtensionDiagnostic.source)..<SourceLocation(line: 1, column: 32, source: unmatchedDocExtensionDiagnostic.source))
2211+
2212+
XCTAssertEqual(unmatchedDocExtensionDiagnostic.summary, "No symbol matched '/ModuleName/UnknownSymbol'. 'UnknownSymbol' doesn't exist at '/ModuleName'.")
2213+
XCTAssertEqual(unmatchedDocExtensionDiagnostic.severity, .warning)
22152214
}
22162215

22172216
func testExtendingSymbolWithSpaceInName() async throws {

Tests/SwiftDocCTests/Infrastructure/DocumentationCuratorTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ class DocumentationCuratorTests: XCTestCase {
425425

426426
func testGroupLinkValidation() async throws {
427427
let (_, _, context) = try await testBundleAndContext(copying: "LegacyBundle_DoNotUseInNewTests", excludingPaths: []) { root in
428-
// Create a sidecar with invalid group links
428+
// Create a documentation extension with invalid group links
429429
try! """
430430
# ``SideKit``
431431
## Topics
@@ -470,7 +470,7 @@ class DocumentationCuratorTests: XCTestCase {
470470
try crawler.crawlChildren(of: reference, prepareForCuration: {_ in }) { (_, _) in }
471471

472472
// Verify the crawler emitted warnings for the 3 invalid links in the sidekit Topics/See Alsos groups
473-
// in both the sidecar and the api collection article
473+
// in both the documentation extension and the api collection article
474474
XCTAssertEqual(crawler.diagnostics.filter({ $0.identifier == "org.swift.docc.UnexpectedTaskGroupItem" }).count, 6)
475475
XCTAssertTrue(crawler.diagnostics
476476
.filter({ $0.identifier == "org.swift.docc.UnexpectedTaskGroupItem" })

Tests/SwiftDocCTests/Model/SemaToRenderNodeTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -944,12 +944,12 @@ class SemaToRenderNodeTests: XCTestCase {
944944

945945
let node = try context.entity(with: ResolvedTopicReference(bundleID: bundle.id, path: "/documentation/MyKit/MyProtocol", sourceLanguage: .swift))
946946

947-
// Verify that `MyProtocol` the symbol is loaded in the topic graph, but the `MyProtocol` sidecar article was removed.
947+
// Verify that `MyProtocol` the symbol is loaded in the topic graph, but the `MyProtocol` documentation extension was removed.
948948
let matches = context.knownPages.filter({ reference -> Bool in
949949
return reference.path.contains("MyProtocol")
950950
})
951951

952-
// Verify the sidecar article was merged successfully into the symbol
952+
// Verify the documentation extension was merged successfully into the symbol
953953
XCTAssertEqual(matches.count, 1)
954954
guard matches.count == 1 else { return }
955955

Tests/SwiftDocCTests/Rendering/RenderNodeTranslatorTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ class RenderNodeTranslatorTests: XCTestCase {
147147

148148
func testAutomaticOverviewAndDiscussionHeadings() async throws {
149149
guard let myFunctionDiscussion = try await findDiscussion(forSymbolPath: "/documentation/MyKit/MyClass/myFunction()", configureBundle: { url in
150-
let sidecarURL = url.appendingPathComponent("/documentation/myFunction.md")
150+
let documentationExtensionURL = url.appendingPathComponent("/documentation/myFunction.md")
151151
try """
152152
# ``MyKit/MyClass/myFunction()``
153153
154154
This is the overview for myFunction.
155-
""".write(to: sidecarURL, atomically: true, encoding: .utf8)
155+
""".write(to: documentationExtensionURL, atomically: true, encoding: .utf8)
156156
}) else {
157157
return
158158
}
@@ -166,15 +166,15 @@ class RenderNodeTranslatorTests: XCTestCase {
166166
)
167167

168168
guard let myClassDiscussion = try await findDiscussion(forSymbolPath: "/documentation/MyKit/MyClass", configureBundle: { url in
169-
let sidecarURL = url.appendingPathComponent("/documentation/myclass.md")
170-
XCTAssert(FileManager.default.fileExists(atPath: sidecarURL.path), "Make sure that this overrides the existing file.")
169+
let documentationExtensionURL = url.appendingPathComponent("/documentation/myclass.md")
170+
XCTAssert(FileManager.default.fileExists(atPath: documentationExtensionURL.path), "Make sure that this overrides the existing file.")
171171
try """
172172
# ``MyKit/MyClass``
173173
174174
This is the abstract (because MyClass doesn't have an in-source abstract).
175175
176176
This is the overview for MyClass.
177-
""".write(to: sidecarURL, atomically: true, encoding: .utf8)
177+
""".write(to: documentationExtensionURL, atomically: true, encoding: .utf8)
178178
}) else {
179179
return
180180
}

0 commit comments

Comments
 (0)