From 81b609d9798553ad9453384ef3608798e892f201 Mon Sep 17 00:00:00 2001 From: Jerry Chen Date: Tue, 11 Nov 2025 18:53:54 -0800 Subject: [PATCH] Link Swift Testing documentation in its test template This hopefully makes it easier for new users to find relevant documentation for our test framework! It also matches the existing pattern where XCTest documentation is linked in its respective test template. --- Sources/Workspace/InitPackage.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/Workspace/InitPackage.swift b/Sources/Workspace/InitPackage.swift index 9625ae7fc3e..c1fe5157f8f 100644 --- a/Sources/Workspace/InitPackage.swift +++ b/Sources/Workspace/InitPackage.swift @@ -549,7 +549,7 @@ public final class InitPackage { func createBuildCommand(for inputPath: URL, in outputDirectoryPath: URL, with generatorToolPath: URL) -> Command? { // Skip any file that doesn't have the extension we're looking for (replace this with the actual one). guard inputPath.pathExtension == "my-input-suffix" else { return .none } - + // Return a command that will run during the build to generate the output file. let inputName = inputPath.lastPathComponent let outputName = inputPath.deletingPathExtension().lastPathComponent + ".swift" @@ -644,7 +644,7 @@ public final class InitPackage { content = """ // The Swift Programming Language // https://docs.swift.org/swift-book - // + // // Swift Argument Parser // https://swiftpackageindex.com/apple/swift-argument-parser/documentation @@ -731,6 +731,8 @@ public final class InitPackage { @Test func example() async throws { // Write your test here and use APIs like `#expect(...)` to check expected conditions. + // Swift Testing Documentation + // https://swiftpackageindex.com/swiftlang/swift-testing/documentation } """