Function interpolate_name::interpolate_test [−][src]
pub fn interpolate_test(attr: TokenStream, item: TokenStream) -> TokenStream
Generate a new test that calls the decorated function with the provided arguments.
The test function name is the same as the called plus _
and specifier
.
Can decorate the same function multiple times.
#[interpolate_test(some, "some", "arguments", 1)] #[interpolate_test(name, "other", "arguments", 42)] fn foo(a: &str, b: &str, c: usize) { println!("{} {} {}", a, b,c); }
produces:
#[test] fn foo_some() { foo("some", "arguments", 1); } #[test] fn foo_name() { foo("other", "arguments", 42); }