Skip to content

Commit 8517508

Browse files
authored
Mention module name and presence in toolchain in README (#1233)
This adds a mention of the testing library's module name (`import Testing`) and its presence in officially-supported Swift toolchains in the `README`. ### Motivation: Some users have been confused about whether they need to declare a package dependency on the `swift-testing` package to use Swift Testing. It's included in Swift toolchains for officially-supported platforms, so we generally do not recommend declaring such a package dependency, and doing so can lead to a degraded experience with integrated tools. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [X] If public symbols are renamed or modified, DocC references should be updated.
1 parent 004acdb commit 8517508

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Swift expressions and operators, and captures the evaluated values so you can
2323
quickly understand what went wrong when a test fails.
2424

2525
```swift
26+
import Testing
27+
2628
@Test func helloWorld() {
2729
let greeting = "Hello, world!"
2830
#expect(greeting == "Hello") // Expectation failed: (greeting → "Hello, world!") == "Hello"
@@ -84,11 +86,19 @@ func mentionedContinents(videoName: String) async throws {
8486

8587
### Cross-platform support
8688

87-
Swift Testing works on all major platforms supported by Swift, including Apple
88-
platforms, Linux, and Windows, so your tests can behave more consistently when
89-
moving between platforms. It’s developed as open source and discussed on the
90-
[Swift Forums](https://forums.swift.org/c/development/swift-testing/103) so the
91-
very best ideas, from anywhere, can help shape the future of testing in Swift.
89+
Swift Testing is included in officially-supported Swift toolchains, including
90+
those for Apple platforms, Linux, and Windows. To use the library, import the
91+
`Testing` module:
92+
93+
```swift
94+
import Testing
95+
```
96+
97+
You don't need to declare a package dependency to use Swift Testing. It's
98+
developed as open source and discussed on the
99+
[Swift Forums](https://forums.swift.org/c/development/swift-testing/103)
100+
so the very best ideas, from anywhere, can help shape the future of testing in
101+
Swift.
92102

93103
The table below describes the current level of support that Swift Testing has
94104
for various platforms:

0 commit comments

Comments
 (0)