| Crates.io | fstest |
| lib.rs | fstest |
| version | 0.2.4 |
| created_at | 2025-04-30 08:55:37.247233+00 |
| updated_at | 2025-04-30 11:46:25.418023+00 |
| description | A procedural macro for testing in tempdirs or git repos |
| homepage | |
| repository | https://github.com/jenskrumsieck/fstest |
| max_upload_size | |
| id | 1654656 |
| size | 42,185 |
fstest provides a procedural macro attribute for simplifying integration tests involving
temporary file system setups and optional Git repository initialization.
This crate defines the #[fstest] macro, which wraps a test function and handles:
use fstest::cmd_test;
#[cmd_test(repo = true, files = ["tests/data/input.txt", "tests/data/config.toml"])] //arguments are optional!
fn my_test() {
// test code working within `tempdir`
}
See examples folder for examples.
Add crate and serial_test and tempfile to your dev dependencies.
[dev-dependencies]
fstest = "*"