Macro test_generator::test_expand_paths
source · test_expand_paths!() { /* proc-macro */ }
Expand description
deprecated Generate a test-function call for each file matching the pattern
extern crate test_generator;
#[cfg(test)]
mod tests {
test_generator::test_expand_paths! { test_exists; "res/*" }
fn test_exists(dir_name: &str) { assert!(std::path::Path::new(dir_name).exists()); }
}
Assuming "res/*"
expands to “res/set1”, and “res/set2” the macro will expand to
mod tests {
#[test]
fn test_exists_res_set1() {
test_exists("res/set1");
}
#[test]
fn test_exists_res_set2() {
test_exists("res/set2");
}
}