Skip to content

Conversation

@stmontgomery
Copy link
Contributor

Represent each parameterized test function argument as a separate element in Test.Case.arguments, including tuple types which have been de-structured into discrete function parameters.

Motivation:

This is an enhancement meant to represent arguments of parameterized test functions in Test.Case instances in a more useful way, and facilitate progress towards allowing (re-)running specific argument(s) of such functions.

Modifications:

  • Introduce a struct Test.Case.Argument which represents one argument passed to one parameter of a parameterized test function. This includes each argument's associated Test.ParameterInfo.
  • Change the Test.Case.arguments property to be an array of the new struct type.
  • Enhance Test.Case.Generator to generate Test.Case instances using the new argument structure—including de-structuring tuples into their constituent elements when needed. It accomplishes this more efficiently now using some specialized generic overloads.
  • Remove Test.Case.arguments(pairedWith:) function, since it's no longer necessary given the arguments property already pairs these values.
  • Introduce a convenience utility for testing purposes only, which handles errors thrown in eventHandler closures.

Checklist:

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

@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@stmontgomery stmontgomery force-pushed the test-case-argument-type branch from 5ffc389 to 7881dc0 Compare November 14, 2023 14:39
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@stmontgomery stmontgomery merged commit 0b00668 into main Nov 14, 2023
@stmontgomery stmontgomery deleted the test-case-argument-type branch November 14, 2023 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants