Skip to content

test: adopt rstest for parameterized tests (#30) - #32

Merged
velocitysystems merged 1 commit into
silvermine:masterfrom
remdalm:feat/rstest
Oct 25, 2026
Merged

velocitysystems merged 1 commit into
silvermine:masterfrom
remdalm:feat/rstest

Conversation

@remdalm

@remdalm remdalm commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@remdalm
remdalm requested a review from a team October 20, 2026 20:41
@remdalm
remdalm marked this pull request as draft October 20, 2026 20:42
@remdalm
remdalm force-pushed the feat/rstest branch 3 times, most recently from 38c92f1 to c306563 Compare October 21, 2026 07:46
@remdalm
remdalm marked this pull request as ready for review October 21, 2026 08:02
Comment thread Cargo.toml Resolved
Comment thread scripts/lint-rstest-attributes.cjs Resolved
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
velocitysystems merged commit d8e7422 into silvermine:master Oct 25, 2026
7 of 8 checks passed
@remdalm
remdalm deleted the feat/rstest branch October 25, 2026 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants