Repository navigation
test: adopt rstest for parameterized tests (#30) - #32
Merged
Merged
Conversation
remdalm
marked this pull request as draft
October 20, 2026 20:42
remdalm
force-pushed
the
feat/rstest
branch
3 times, most recently
from
October 21, 2026 07:46
38c92f1 to
c306563
Compare
remdalm
marked this pull request as ready for review
October 21, 2026 08:02
A test that loops over inputs, or puts one assert per input in one function, stops at the first failing input, reports one failure for the whole list, and cargo test cannot run one input on its own. rstest generates one test per #[case], so a run reports every failing input by name and each one can be run alone. A test becomes an rstest table when it checks one function against independent inputs with the same assertions and the table reads at least as well as the code it replaces. Every input is kept as a named case, and separate tests that differed only in their inputs are merged. Inputs that need different checks, such as accepted and rejected values, get separate tables or tests, so every case of a table runs the same assertions and its name holds for each case. The rest stays as it was: scenario tests with their own setup, loops over the results of one setup or that carry state between steps, two-input tests that would need a helper or a wide case signature to fit a table, and everything the Android JVM harness runs, because rstest only generates test-build code and the harness is not a test build. rstest is a dev-dependency of both crates with default features off. It adds rstest, rstest_macros and relative-path to Cargo.lock.
velocitysystems
approved these changes
Oct 25, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.