This is a μ-crate which exposes a single attribute, test_with_parameters
, which can be used to create parameterised unit tests.
```rust
mod tests { #[testwithparameters( [ "input" , "expected" ] [ None , "Hello, World!" ] [ Some("me") , "Hello, me!" ] )] fn hellotests(input: Option<&str>, expected: &str) { asserteq(expected, hello(input)) } } ```
This desugars to:
```rust
mod tests { fn hellotests(input: Option<&str>, expected: &str) { asserteq(expected, hello(input)) }
#[test]
fn hello_tests_case0() {
hello_tests(None, "Hello, World!")
}
#[test]
fn hello_tests_case1() {
hello_tests(Some("me"), hello(input))
}
} ```