bitwizeshift / oxtest

🚧 A WIP rust unit-testing library
https://bitwizeshift.github.io/neotest
Apache License 2.0
0 stars 0 forks source link

Restructure test inputs #10

Open bitwizeshift opened 1 year ago

bitwizeshift commented 1 year ago

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:

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.