Skip to content

Clarify the number of supported argument collections in article which discusses combinatoric parameterized testing #1210

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

Merged
merged 2 commits into from
Jul 8, 2025

Conversation

stmontgomery
Copy link
Contributor

This is a small adjustment to the documentation article Implementing parameterized tests, in the section Test with more than one collection. It currently has a sentence which ends:

…, elements from the second collection are passed as the second argument, and so forth.

The "and so forth" has caused some confusion since it implies that you can pass more than two argument collections, but in reality only two are supported currently. Eventually this could potentially be expanded with further improvements to the testing library, but that is tracked separately and the docs should reflect its current capabilities.

Fixes rdar://154647425

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

… discusses combinatoric parameterized testing

Fixes rdar://154647425
@stmontgomery stmontgomery added this to the Swift 6.x (main) milestone Jul 8, 2025
@stmontgomery stmontgomery requested a review from iamleeg July 8, 2025 01:52
@stmontgomery stmontgomery self-assigned this Jul 8, 2025
@stmontgomery stmontgomery added documentation 📚 Improvements or additions to documentation enhancement New feature or request parameterized-testing Related to parameterized testing functionality labels Jul 8, 2025
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@iamleeg iamleeg left a comment

Choose a reason for hiding this comment

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

That makes things clearer, thanks!

@@ -146,11 +146,11 @@ func makeLargeOrder(of food: Food, count: Int) async throws {
```

Elements from the first collection are passed as the first argument to the test
function, elements from the second collection are passed as the second argument,
and so forth.
function, and elements from the second collection are passed as the second
Copy link
Contributor

Choose a reason for hiding this comment

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

This strictly isn't true (wasn't before either) due to tuple desugaring. Do we want to adjust the phrasing to mention that somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This sentence refers to the code example which precedes it, and I think if you zoom out and reread the section in its entity it is clear in context.

Then, the subsequent paragraphs contrast it with the tuple desugaring behavior:

To avoid the combinatoric semantics shown above, use zip():
[…]
The zipped sequence will be “destructured” into two arguments automatically, then passed to the test function for evaluation.

@stmontgomery stmontgomery merged commit 3c8e4e8 into swiftlang:main Jul 8, 2025
@stmontgomery stmontgomery deleted the combinatoric-docs branch July 8, 2025 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation 📚 Improvements or additions to documentation enhancement New feature or request parameterized-testing Related to parameterized testing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants