Currently the #[files] for #[rstest] creates a test for each file and gives the path to each file as a PathBuf. It would be nice to have an option to instead embed the files in the resulting test binary instead of having to read them from the given path. If the files contain a directory it would probably be fine to report an error.
So something along these lines:
#[rstest]
fn test(#[files("tests/*.json)] #[embed] json_file: &str) {
todo!()
}
We could implement this using include_str!.
Currently the
#[files]for#[rstest]creates a test for each file and gives the path to each file as aPathBuf. It would be nice to have an option to instead embed the files in the resulting test binary instead of having to read them from the given path. If the files contain a directory it would probably be fine to report an error.So something along these lines:
We could implement this using
include_str!.