Skip to content

Remove miscellaneous unused test code #1262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
*/

import XCTest
@testable import SwiftDocC

class DocumentationBundleTests: XCTestCase {
// Test whether the bundle correctly loads a documentation source folder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,14 @@ class InheritIntroducedAvailabilityTests: XCTestCase {
typealias Domain = SymbolGraph.Symbol.Availability.Domain
typealias Version = SymbolGraph.SemanticVersion

var testBundle: DocumentationBundle!
var context: DocumentationContext!

override func setUp() async throws {
try await super.setUp()
(testBundle, context) = try await testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
(_, context) = try await testBundleAndContext(named: "LegacyBundle_DoNotUseInNewTests")
}

override func tearDown() {
testBundle = nil
context = nil
super.tearDown()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand All @@ -14,8 +14,6 @@ import XCTest
@testable import SwiftDocC

class NodeURLGeneratorTests: XCTestCase {
let generator = NodeURLGenerator()

let unchangedURLs = [
URL(string: "doc://com.bundle/folder-prefix/type/symbol")!,
URL(string: "doc://com.bundle/fol.der-pref.ix./type-swift.class/symbol.name.")!,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -910,9 +910,7 @@ class ParametersAndReturnValidatorTests: XCTestCase {
docComment: String,
docCommentModuleName: String? = "ModuleName",
parameters: [(name: String, externalName: String?)],
returnValue: SymbolGraph.Symbol.DeclarationFragments.Fragment,
file: StaticString = #filePath,
line: UInt = #line
returnValue: SymbolGraph.Symbol.DeclarationFragments.Fragment
) async throws -> String {
let fileSystem = try TestFileSystem(folders: [
Folder(name: "path", content: [
Expand Down
6 changes: 1 addition & 5 deletions Tests/SwiftDocCTests/Model/TaskGroupTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -68,10 +68,6 @@ class SectionExtractionTests: XCTestCase {
}
}

private func testNode(with document: Document) -> DocumentationNode {
return DocumentationNode(reference: ResolvedTopicReference(bundleID: "org.swift.docc", path: "/blah", sourceLanguage: .swift), kind: .article, sourceLanguage: .swift, name: .conceptual(title: "Title"), markup: document, semantic: Semantic())
}

func testSection() {
// Empty -> nil
do {
Expand Down
26 changes: 0 additions & 26 deletions Tests/SwiftDocCTests/Rendering/SymbolAvailabilityTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,6 @@ import SwiftDocCTestUtilities

class SymbolAvailabilityTests: XCTestCase {

private func symbolAvailability(
defaultAvailability: [DefaultAvailability.ModuleAvailability] = [],
symbolGraphOperatingSystemPlatformName: String,
symbols: [SymbolGraph.Symbol],
symbolName: String
) async throws -> [SymbolGraph.Symbol.Availability.AvailabilityItem] {
let catalog = Folder(
name: "unit-test.docc",
content: [
InfoPlist(defaultAvailability: [
"ModuleName": defaultAvailability
]),
JSONFile(name: "ModuleName.symbols.json", content: makeSymbolGraph(
moduleName: "ModuleName",
platform: SymbolGraph.Platform(architecture: nil, vendor: nil, operatingSystem: SymbolGraph.OperatingSystem(name: symbolGraphOperatingSystemPlatformName), environment: nil),
symbols: symbols,
relationships: []
)),
]
)
let (_, context) = try await loadBundle(catalog: catalog)
let reference = try XCTUnwrap(context.soleRootModuleReference).appendingPath(symbolName)
let symbol = try XCTUnwrap(context.entity(with: reference).semantic as? Symbol)
return try XCTUnwrap(symbol.availability?.availability)
}

private func renderNodeAvailability(
defaultAvailability: [DefaultAvailability.ModuleAvailability] = [],
symbolGraphOperatingSystemPlatformName: String,
Expand Down
6 changes: 1 addition & 5 deletions Tests/SwiftDocCTests/Utility/LMDBTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -258,10 +258,6 @@ final class SwiftLMDBTests: XCTestCase {
XCTAssertEqual(value, [1,2,3,4,5,6,7,8,9,10,11,12,13,14])
#endif
}

static var allTests = [
("testVersion", testVersion),
]
}

// MARK: - Custom Objects
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand All @@ -10,7 +10,6 @@

import XCTest
import SymbolKit
@testable import SwiftDocC

class SemanticVersion_ComparableTests: XCTestCase {
private typealias Version = SymbolGraph.SemanticVersion
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2024 Apple Inc. and the Swift project authors
Copyright (c) 2024-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand All @@ -11,7 +11,6 @@
import XCTest
import ArgumentParser
@testable import SwiftDocCUtilities
@testable import SwiftDocC
import SwiftDocCTestUtilities

class MergeSubcommandTests: XCTestCase {
Expand Down
4 changes: 2 additions & 2 deletions Tests/SwiftDocCUtilitiesTests/DirectoryMonitorTests.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand Down Expand Up @@ -91,7 +91,7 @@ class DirectoryMonitorTests: XCTestCase {
/// - Warning: Please do not overuse this method as it takes 10s of wait time and can potentially slow down running the test suite.
private func monitorNoUpdates(url: URL, testBlock: @escaping () throws -> Void, file: StaticString = #filePath, line: UInt = #line) throws {
let monitor = try DirectoryMonitor(root: url) { rootURL, url in
XCTFail("Did produce file update event for a hidden file")
XCTFail("Did produce file update event for a hidden file", file: file, line: line)
}

try monitor.start()
Expand Down
3 changes: 1 addition & 2 deletions Tests/SwiftDocCUtilitiesTests/FolderStructureTests.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
*/

import XCTest
@testable import SwiftDocC
import SwiftDocCTestUtilities

class FolderStructureTests: XCTestCase {
Expand Down
3 changes: 1 addition & 2 deletions Tests/SwiftDocCUtilitiesTests/HTMLTemplateDirectory.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
*/

import Foundation
@testable import SwiftDocC
import SwiftDocCTestUtilities

/// A folder that represents a fake html-build directory for testing.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand All @@ -11,7 +11,6 @@
#if canImport(NIOHTTP1)
import Foundation
import XCTest
@testable import SwiftDocC
@testable import SwiftDocCUtilities
import SwiftDocCTestUtilities

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand All @@ -11,7 +11,6 @@
#if canImport(NIOHTTP1)
import Foundation
import XCTest
@testable import SwiftDocC
@testable import SwiftDocCUtilities
import SwiftDocCTestUtilities

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand All @@ -11,7 +11,6 @@
#if canImport(NIOHTTP1)
import Foundation
import XCTest
@testable import SwiftDocC
@testable import SwiftDocCUtilities

import NIO
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand All @@ -11,16 +11,13 @@
#if canImport(NIOHTTP1)
import Foundation
import XCTest
@testable import SwiftDocC
@testable import SwiftDocCUtilities
import SwiftDocCTestUtilities

import NIO
import NIOHTTP1

class FileRequestHandlerTests: XCTestCase {
let fileIO = NonBlockingFileIO(threadPool: NIOThreadPool(numberOfThreads: 2))

private func verifyAsset(root: URL, path: String, body: String, type: String, file: StaticString = #filePath, line: UInt = #line) throws {
let request = makeRequestHead(uri: path)
let factory = FileRequestHandler(rootURL: root)
Expand Down
3 changes: 1 addition & 2 deletions Tests/SwiftDocCUtilitiesTests/SignalTests.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
*/

import XCTest
@testable import SwiftDocCUtilities

class SignalTests: XCTestCase {
#if os(macOS) || os(Linux) || os(Android)
Expand Down
4 changes: 1 addition & 3 deletions Tests/SwiftDocCUtilitiesTests/StaticHostingBaseTest.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
Expand All @@ -10,8 +10,6 @@

import XCTest
import Foundation
@testable import SwiftDocC
@testable import SwiftDocCUtilities

class StaticHostingBaseTests: XCTestCase {

Expand Down
4 changes: 1 addition & 3 deletions Tests/SwiftDocCUtilitiesTests/Utility/FileTests.swift
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
/*
This source file is part of the Swift.org open source project

Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
Copyright (c) 2021-2025 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception

See https://swift.org/LICENSE.txt for license information
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
*/

import XCTest
@testable import SwiftDocC
@testable import SwiftDocCUtilities
import SwiftDocCTestUtilities

class FileTests: XCTestCase {
Expand Down