1 unstable release
0.1.0 | Sep 17, 2023 |
---|
#2272 in Procedural macros
5KB
73 lines
fixtures
fixtures
is a Rust crate which allows developers to run tests against fixture files.
#[cfg(test)]
mod tests {
use fixtures::fixtures;
#[fixtures("fixtures/*.txt")]
fn test(path: &std::path::Path) {
// This test will be run once for each file matching the glob pattern
}
}
The above example expands to:
#[cfg(test)]
mod tests {
use fixtures::fixtures;
fn test(path: &std::path::Path) {
// This test will be run once for each file matching the glob pattern
}
#[test]
fn test_one_dot_txt_1() {
test(::std::path::Path::new("fixtures/one.txt"));
}
#[test]
fn test_two_dot_txt_1() {
test(::std::path::Path::new("fixtures/two.txt"));
}
// ...
}
Dependencies
~290–750KB
~18K SLoC