Attribute Macro test_each::blob

source ·
#[blob]
Expand description

Generate a series of tests that receive file contents as byte slices, based on the result of a glob pattern.

This excludes any matched directories.

Usage

#[test_each::blob("data/*.bin")]
fn test_bytes(content: &[u8]) {
    // test contents
}

Add a second parameter of type PathBuf to receive the path of the file.

#[test_each::blob("data/*.bin")]
fn test_bytes(content: &[u8], path: PathBuf) {
    // test contents
}