#[glob_test]Expand description
A macro that expands a single test case parameterized by a single &str
parameter into a family of tests with the same name used as prefix for each
file found in a glob pattern at compile time.
ยงExample
Assume that your cargo project has a testdata folder with the following
structure:
foobar.mdbaz.md
Then the expansion
use spectest_macros::glob_test;
#[glob_test("testdata/foo/**/*.md")]
fn test_foo(path: &str) {
println!("Running test at path = {path}");
}will be
fn test_foo(path: &str) {
println!("Running test at path = {path}");
}
#[test]
fn test_foo_bar() {
test_foo("/path/to/crate/testdata/foo/bar.md")
}
#[test]
fn test_foo_baz() {
test_foo("/path/to/crate/testdata/foo/baz.md")
}