Skip to content
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
Expand Up @@ -47,7 +47,7 @@
///
/// You do not generally need to add your own conformances to this protocol. For
/// a list of types that automatically conform to this protocol, see
/// <doc:Attachments#Attach-images>.
/// <doc:attachments#Attach-images>.
///
/// @Metadata {
/// @Available(Swift, introduced: 6.3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
/// ``encodeTestArgument(to:)`` on the argument. A type that conforms to this
/// protocol is not required to conform to either `Encodable` or `Decodable`.
///
/// See <doc:ParameterizedTesting> for a list of the other supported ways to
/// See <doc:parameterized-testing> for a list of the other supported ways to
/// allow running selected test cases.
///
/// ## See Also
///
/// - <doc:ParameterizedTesting>
/// - <doc:parameterized-testing>
public protocol CustomTestArgumentEncodable: Sendable {
/// Encode this test argument.
///
Expand Down
16 changes: 8 additions & 8 deletions Sources/Testing/Test+Macro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public typealias __XCTestCompatibleSelector = Never
///
/// ## See Also
///
/// - <doc:OrganizingTests>
/// - <doc:organizing-tests>
@attached(peer)
@_documentation(visibility: private)
public macro Suite(
Expand All @@ -92,7 +92,7 @@ public macro Suite(
///
/// ## See Also
///
/// - <doc:OrganizingTests>
/// - <doc:organizing-tests>
@attached(peer) public macro Suite(
_ displayName: _const String? = nil,
_ traits: any SuiteTrait...
Expand Down Expand Up @@ -138,7 +138,7 @@ public macro Test(
///
/// ## See Also
///
/// - <doc:DefiningTests>
/// - <doc:defining-tests>
@attached(peer) public macro Test(
_ displayName: _const String? = nil,
_ traits: any TestTrait...
Expand Down Expand Up @@ -227,7 +227,7 @@ public macro Test<C>(
///
/// ## See Also
///
/// - <doc:DefiningTests>
/// - <doc:defining-tests>
@attached(peer) public macro Test<C>(
_ displayName: _const String? = nil,
_ traits: any TestTrait...,
Expand Down Expand Up @@ -283,7 +283,7 @@ extension Test {
///
/// ## See Also
///
/// - <doc:DefiningTests>
/// - <doc:defining-tests>
@attached(peer)
@_documentation(visibility: private)
public macro Test<C1, C2>(
Expand Down Expand Up @@ -314,7 +314,7 @@ public macro Test<C1, C2>(
///
/// ## See Also
///
/// - <doc:DefiningTests>
/// - <doc:defining-tests>
@attached(peer) public macro Test<C1, C2>(
_ displayName: _const String? = nil,
_ traits: any TestTrait...,
Expand Down Expand Up @@ -343,7 +343,7 @@ public macro Test<C1, C2>(
///
/// ## See Also
///
/// - <doc:DefiningTests>
/// - <doc:defining-tests>
@attached(peer)
@_documentation(visibility: private)
public macro Test<C1, C2>(
Expand Down Expand Up @@ -374,7 +374,7 @@ public macro Test<C1, C2>(
///
/// ## See Also
///
/// - <doc:DefiningTests>
/// - <doc:defining-tests>
@attached(peer) public macro Test<C1, C2>(
_ displayName: _const String? = nil,
_ traits: any TestTrait...,
Expand Down
14 changes: 7 additions & 7 deletions Sources/Testing/Testing.docc/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ their problems.

### Essentials

- <doc:DefiningTests>
- <doc:OrganizingTests>
- <doc:MigratingFromXCTest>
- <doc:defining-tests>
- <doc:organizing-tests>
- <doc:migrating-from-xctest>
Comment on lines +45 to +47

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- <doc:defining-tests>
- <doc:organizing-tests>
- <doc:migrating-from-xctest>
- <doc:defining-test-functions>
- <doc:organizing-test-functions-with-suite-types>
- <doc:migrating-from-xctest>

- ``Test(_:_:)``
- ``Test``
- ``Suite(_:_:)``

### Test parameterization

- <doc:ParameterizedTesting>
- <doc:parameterized-testing>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- <doc:parameterized-testing>
- <doc:implementing-parameterized-tests>

- ``Test(_:_:arguments:)-8kn7a``
- ``Test(_:_:arguments:_:)``
- ``Test(_:_:arguments:)-3rzok``
Expand All @@ -61,12 +61,12 @@ their problems.

### Behavior validation

- <doc:Expectations>
- <doc:expectations>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- <doc:expectations>
- <doc:expectations-and-confirmations>

- <doc:known-issues>

### Test customization

- <doc:Traits>
- <doc:traits>

### Value description and reflection

Expand All @@ -76,4 +76,4 @@ their problems.

### Data collection

- <doc:Attachments>
- <doc:attachments>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the example in the style guide, the filename should match the title of the page, so adding-comments-to-tests.md.

From the style guide:

For example, if the title of your article is Adding tags to tests, the
filename would be adding-tags-to-tests.md, or if the title of the collection
page is Event tags, the filename would be event-tags.md.

Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ As in normal code, comments on tests are generally most useful when they:
- Provide useful information about the operation or motivation of a test

If a test is related to a bug or issue, consider using the ``Bug`` trait instead
of comments. For more information, see <doc:AssociatingBugs>.
of comments. For more information, see <doc:associating-bugs>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
of comments. For more information, see <doc:associating-bugs>.
of comments. For more information, see <doc:associating-bugs-with-tests>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained above, this should be adding-tags-to-tests.md.

File renamed without changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained above, this should be associating-bugs-with-tests.md.

Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func engineWorks() async {
A bug's URL is passed as a string and must be parseable according to
[RFC&nbsp;3986](https://www.ietf.org/rfc/rfc3986.txt). A bug's unique identifier
can be passed as an integer or as a string. For more information on the formats
recognized by the testing library, see <doc:BugIdentifiers>.
recognized by the testing library, see <doc:bug-identifiers>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
recognized by the testing library, see <doc:bug-identifiers>.
recognized by the testing library, see <doc:interpreting-bug-identifiers>.


## Add titles to associated bugs

Expand Down

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained above, this should be interpreting-bug-identifiers.md.

File renamed without changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained above, this should be defining-test-functions.md.

Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ take any arguments, then prefix its name with the `@Test` attribute:
This test function can be present at file scope or within a type. A type
containing test functions is automatically a _test suite_ and can be optionally
annotated with the `@Suite` attribute. For more information about suites, see
<doc:OrganizingTests>.
<doc:organizing-tests>.

Note that, while this function is a valid test function, it doesn't actually
perform any action or test any code. To check for expected values and outcomes
in test functions, add [expectations](doc:Expectations) to the test function.
in test functions, add [expectations](doc:expectations) to the test function.

### Customize a test's name

Expand All @@ -62,7 +62,7 @@ line, supply a string literal as an argument to the `@Test` attribute:
```

To further customize the appearance and behavior of a test function, use
[traits](doc:Traits) such as ``Trait/tags(_:)``.
[traits](doc:traits) such as ``Trait/tags(_:)``.

### Write concurrent or throwing tests

Expand Down

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained above, this should be enabling-and-disabling-tests.md

File renamed without changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained above, this should be expectations-and-confirmations.md

File renamed without changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained above, this should be limiting-the-running-time-of-tests.md

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ concurrency safety:
}

For more information about suites and how to declare and customize them, see
<doc:OrganizingTests>.
<doc:organizing-tests>.

### Convert setup and teardown functions

Expand Down Expand Up @@ -202,7 +202,7 @@ As with XCTest, the testing library allows test functions to be marked `async`,
[`MainActor.run(resultType:body:)`](https://developer.apple.com/documentation/swift/mainactor/run(resulttype:body:)).

For more information about test functions and how to declare and customize them,
see <doc:DefiningTests>.
see <doc:defining-tests>.

### Check for expected values and outcomes

Expand Down Expand Up @@ -773,7 +773,7 @@ suite serially:
}
}

For more information, see <doc:Parallelization>.
For more information, see <doc:parallelization>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For more information, see <doc:parallelization>.
For more information, see <doc:running-tests-serially-or-in-parallel>.


### Attach values

Expand Down Expand Up @@ -837,7 +837,7 @@ equivalent interface in Swift Testing. -->

## See Also

- <doc:DefiningTests>
- <doc:OrganizingTests>
- <doc:Expectations>
- <doc:defining-tests>
- <doc:organizing-tests>
- <doc:expectations>
Comment on lines +840 to +842

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- <doc:defining-tests>
- <doc:organizing-tests>
- <doc:expectations>
- <doc:defining-test-functions>
- <doc:organizing-test-functions-with-suite-types>
- <doc:expectations-and-confirmations>

- <doc:known-issues>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained above, this should be organizing-test-functions-with-suite-types.md

Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ within them. To add a nested test suite type, simply declare an additional type
within the scope of the outer test suite type.

By default, tests contained within a suite run in parallel with each other.
For more information about test parallelization, see <doc:Parallelization>.
For more information about test parallelization, see <doc:parallelization>.

### Customize a suite's name

Expand All @@ -50,7 +50,7 @@ To customize a test suite's name, supply a string literal as an argument to the
```

To further customize the appearance and behavior of a test function, use
[traits](doc:Traits) such as ``Trait/tags(_:)``.
[traits](doc:traits) such as ``Trait/tags(_:)``.

## Test functions in test suite types

Expand Down

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained above, this should be running-tests-serially-or-in-parallel.md

File renamed without changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained above, this should be implementing-parameterized-tests.md

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ a test _case_.

By default, the test cases of a test function run in parallel with each
other. For more information about test parallelization, see
<doc:Parallelization>.
<doc:parallelization>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<doc:parallelization>.
<doc:running-tests-serially-or-in-parallel>.


### Parameterize over an array of values

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ types that customize the behavior of your tests.

### Customizing runtime behaviors

- <doc:EnablingAndDisabling>
- <doc:LimitingExecutionTime>
- <doc:enabling-and-disabling>
- <doc:limiting-execution-time>
Comment on lines +26 to +27

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- <doc:enabling-and-disabling>
- <doc:limiting-execution-time>
- <doc:enabling-and-disabling-tests>
- <doc:limiting-the-running-time-of-tests>

- ``Trait/enabled(if:_:sourceLocation:)``
- ``Trait/enabled(_:sourceLocation:_:)``
- ``Trait/disabled(_:sourceLocation:)``
Expand All @@ -34,15 +34,15 @@ types that customize the behavior of your tests.

### Running tests serially or in parallel

- <doc:Parallelization>
- <doc:parallelization>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- <doc:parallelization>
- <doc:running-tests-serially-or-in-parallel>

- ``Trait/serialized``

### Annotating tests

- <doc:AddingTags>
- <doc:AddingComments>
- <doc:AssociatingBugs>
- <doc:BugIdentifiers>
- <doc:adding-tags>
- <doc:adding-comments>
- <doc:associating-bugs>
- <doc:bug-identifiers>
Comment on lines +42 to +45

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- <doc:adding-tags>
- <doc:adding-comments>
- <doc:associating-bugs>
- <doc:bug-identifiers>
- <doc:adding-tags-to-tests>
- <doc:adding-comments-to-tests>
- <doc:associating-bugs-with-tests>
- <doc:interpreting-bug-identifiers>

- ``Tag()``
- ``Trait/bug(_:_:)``
- ``Trait/bug(_:id:_:)-10yf5``
Expand Down
2 changes: 1 addition & 1 deletion Sources/Testing/Traits/Bug.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public struct Bug {
/// available.
///
/// For more information on how the testing library interprets bug
/// identifiers, see <doc:BugIdentifiers>.
/// identifiers, see <doc:bug-identifiers>.
public var id: String?

/// The human-readable title of the bug, if specified by the test author.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Testing/Traits/Comment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/// which may be helpful when diagnosing issues recorded by a test.
///
/// To add a comment to a test or suite, add a code comment before its `@Test`
/// or `@Suite` attribute. See <doc:AddingComments> for more details.
/// or `@Suite` attribute. See <doc:adding-comments> for more details.
///
/// - Note: To reference bugs related to a test, use ``Trait/bug(_:_:)``,
/// ``Trait/bug(_:id:_:)-10yf5``, or ``Trait/bug(_:id:_:)-3vtpl``.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Testing/Traits/Tags/Tag+Macro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ extension Tag {
///
/// Use this tag with members of the ``Tag`` type declared in an extension to
/// mark them as usable with tests. For more information on declaring tags, see
/// <doc:AddingTags>.
/// <doc:adding-tags>.
@attached(accessor) @attached(peer) public macro Tag() = #externalMacro(module: "TestingMacros", type: "TagMacro")
2 changes: 1 addition & 1 deletion Sources/Testing/Traits/Tags/Tag.Color+Loading.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ var swiftTestingDirectoryPath: String? {
/// in the directory specified by `swiftTestingDirectoryPath`. The file is
/// assumed to contain a JSON object (a dictionary) where the keys are tags'
/// string values and the values represent tag colors. For a list of the
/// supported formats for tag colors in this dictionary, see <doc:AddingTags>.
/// supported formats for tag colors in this dictionary, see <doc:adding-tags>.
func loadTagColors(fromFileInDirectoryAtPath swiftTestingDirectoryPath: String? = swiftTestingDirectoryPath) throws -> [Tag: Tag.Color] {
#if !SWT_NO_CODABLE
guard let swiftTestingDirectoryPath else {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Testing/Traits/Tags/Tag.Color.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extension Tag {
///
/// ## See Also
///
/// - <doc:AddingTags>
/// - <doc:adding-tags>
@_spi(Experimental)
public struct Color: Sendable {
/// The red component of the color.
Expand Down
Loading