This crate tries to improve testing in Rust with a more full-featured framework. It makes tests more readable with better assertions and with more readable errors:
Read the user guide for instructions on how to use this crate in your own projects.
See docs.rs for the API documentation and crates.io to install.
- Floating-point assertions
- String assertions
- Panic assertions
- Output assertions for
stdout
andstderr
- Filesystem assertions
See the user guide for a full list of assertion macros you can use.
#[test_with_parameter_values(
x = [5, 6, 7],
y = [1, 2])
]
fn example(x: i32, y: i32) {
// This will permute the values and automatically run all of these cases:
// x == 5, y == 1
// x == 5, y == 2
// x == 6, y == 1
// x == 6, y == 2
// x == 7, y == 1
// x == 7, y == 2
}
See the contributing guide.
This project uses rust-vscode-template, which has instructions on how to use it.