test ur code XD :3
GitHub repository | crates.io | docs.rs
test ur code XD is a Rust crate that tries to improve testing with a more full-featured framework. It makes tests more readable with better assertions and with more readable errors.
Features
More assertions
- Floating-point assertions
- String assertions
- Panic assertions
- Output assertions for
stdout
andstderr
- Filesystem assertions
Parameterized tests
#[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
}
Comparison to other crates
Category | test ur code XD | Built-in | pretty_assertions | similar-asserts | test-case | rstest | NTest |
---|---|---|---|---|---|---|---|
Pretty assertions | ✔ | ✔ | ✔ | ||||
Floating-point assertions | ✔ | ✔ | |||||
Diffing assertions | ✔ | ✔ | ✔ | ||||
Panic assertions | ✔ | ✔ | |||||
Output assertions | ✔ | ||||||
Filesystem testing | ✔ | ||||||
Parameterized tests | ✔ | ✔ | ✔ | ||||
Test permutation | ✔ | ✔ | ✔ | ||||
Fixtures | ✔ |