Skip to content
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

Restructure test inputs #10

Open
bitwizeshift opened this issue Mar 16, 2023 · 0 comments
Open

Restructure test inputs #10

bitwizeshift opened this issue Mar 16, 2023 · 0 comments
Labels
🔨 Enhancement New feature or request

Comments

@bitwizeshift
Copy link
Owner

The current approach to inputs works, but is a little counter-intuitive due to the combinatoric nature of the arguments. This also suffers when combined with subsections, since cohesion may drop if some subtests don't require inputs while others do.

Thus, this provides a different proposal: rather than using parameters = , provide an inputs![ ... ] macro that expands into an array that selects the correct input at runtime from the current __Context.

This could be implemented in the following way:

  • __Context now stores current input state (no longer just the section path).
    • This logic needs to be tied per-section, since sections may now start their own input fields
  • Have a inputs![...] macro that expands, effectively, into [...].into_iter().nth(__context.input_index())
  • Have each base-test context iterate through all possible inputs
  • Inputs now need to be determined by examining the unit test for each inputs![...] macro being used. This is applied per subtest.

This will now require a significant restructure to tests. Having subtests be able to drive parameters means that we no longer have a fixed inputs -> subtests ordering, but rather an arbitrary re-nesting of this.

@bitwizeshift bitwizeshift added the 🔨 Enhancement New feature or request label Mar 16, 2023
@bitwizeshift bitwizeshift changed the title Restructure inputs Restructure test inputs Mar 16, 2023
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

No branches or pull requests

1 participant