Skip to content

Combine a parameterized test case's argument IDs into a single hashed ID#1799

Merged
suzannaratcliff merged 3 commits into
swiftlang:mainfrom
suzannaratcliff:suzysilver/hash-arg-ids-together
Jul 20, 2026
Merged

Combine a parameterized test case's argument IDs into a single hashed ID#1799
suzannaratcliff merged 3 commits into
swiftlang:mainfrom
suzannaratcliff:suzysilver/hash-arg-ids-together

Conversation

@suzannaratcliff

@suzannaratcliff suzannaratcliff commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Combine a parameterized test case's argument IDs into a single hashed ID

Motivation:

Test.Case.ID.argumentIDs previously stored one Argument.ID per argument, in order. This meant the ID grew with the number of parameters. I want to simplify this to a single combined ID that identifies the whole combination of arguments.

rdar://182725918

Checklist:

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

init(combining argumentIDs: some Sequence<Test.Case.Argument.ID>) {
var bytes = [UInt8]()
for argumentID in argumentIDs {
var count = UInt64(argumentID.bytes.count).littleEndian

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.

Do we need this ID to be stable across architectures? It may be sufficient to just encode the Int.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Probably not, this is a good point. Thanks! Updated.

@suzannaratcliff
suzannaratcliff force-pushed the suzysilver/hash-arg-ids-together branch from 7f6678c to 8baa72d Compare July 20, 2026 17:24
@suzannaratcliff
suzannaratcliff merged commit 66bd926 into swiftlang:main Jul 20, 2026
32 of 35 checks passed
@suzannaratcliff
suzannaratcliff deleted the suzysilver/hash-arg-ids-together branch July 20, 2026 18:09
@stmontgomery stmontgomery added enhancement New feature or request parameterized-testing Related to parameterized testing functionality labels Jul 20, 2026
@stmontgomery stmontgomery added this to the Swift 6.5.0 (main) milestone Jul 20, 2026
suzannaratcliff added a commit that referenced this pull request Jul 20, 2026
…e hashed ID (#1806)

**- Explanation**: Simplifies `Test.Case.ID.argumentIDs` to a single
combined ID that identifies the whole combination of arguments
**- Scope**: `Test.Case.ID.argumentIDs`
**- Issues**: N/A
**- Original PRs**: #1799
**- Risk**: Low
**- Testing**: New unit test added.
**- Reviewers**: @stmontgomery @grynspan 

rdar://182725918

Co-authored-by: Suzy Silver <suzysilver@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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