paramtest
With paramtest, you can define multiple sets of input values for a single test function, and each set will be run as a separate test case.
Example
Here's how you can use paramtest in your tests:
use paramtest;
This is effectively the same as writing the following:
Each #[paramtest(...)] attribute defines named test cases with their own arguments. The macro will generate a separate test for each case, making your tests concise and easy to maintain.
Usage
- Add
paramtestcrate as a dependency in yourCargo.toml. - Annotate your test functions with
#[paramtest(...)]and provide named cases with argument tuples.
License
MIT