efes 1.0.1

A collection of macros to simplify testing involving filesystems
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented2 out of 2 items with examples
  • Size
  • Source code size: 32.35 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.08 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • tsoutsman/efes
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • tsoutsman

efes

Crates.io Docs.rs CI

A collection of macros to simplify testing involving filesystems. The crate exposes two macros: gen_fs and gen_paths. gen_fs is used to actually create files on the system in a given directory. gen_paths generates a vector of paths based on the provided input.

Example

gen_fs

let root_dir = PathBuf::from("/home/user");
gen_fs!(root_dir => (a: file1 file2) b c (another_directory: foo bar));

which would create a directory structure in root_dir equivalent to the following:

.
├── a
│   ├── file1
│   └── file2
├── another_directory
│   ├── bar
│   └── foo
├── b
└── c

gen_paths

let root_dir = PathBuf::from("/home/user");
let expected = gen_paths!(root_dir => (a: file1 file2) b c (another_directory: foo bar));
assert_eq!(expected, vec![
    root_dir.join("a").join("file1"),
    root_dir.join("a").join("file2"),
    root_dir.join("b"),
    root_dir.join("c"),
    root_dir.join("another_directory").join("foo"),
    root_dir.join("another_directory").join("bar"),
]);

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

See CONTRIBUTING.md.