-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
For example, I want to test all formats from kaitai-struct gallery. I use following code (folder formats is git checkout of https://github.com/kaitai-io/kaitai_struct_formats repository):
#[cfg(test)]
mod formats {
use std::fs::File;
use test_generator::test_resources;
use super::Ksy;
#[test_resources("formats/**/*.ksy")]
fn parse(resource: &str) {
let file = File::open(resource).expect(&format!("can't read file {}", resource));
let _: Ksy = serde_yaml::from_reader(file).expect(&format!("invalid file {}", resource));
}
}and get following output:
test parser::formats::parse_formats_archive_cpio_old_le_ksy ... ok
...
Generated function name seems repeat module name. I would be like see something like
test parser::formats::parse_archive_cpio_old_le_ksy ... ok
...
That can be implemented, for example, by introducing capture group in glob pattern, something like #[test_resources("formats/(**/*).ksy")]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels