1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
pub use directree_macros::*; #[cfg(test)] mod test { mod paths { use crate::directree; directree! { something: "something.toml", somewhere: "somewhere" { something_else: "somethingelse.toml", aaa: "asht" { bbb: "neoi" { empty: "nothing_here" {}, not_empty: "a_file.txt", not_empty_2: "a_file.txt", } } } } } #[test] fn directree_macro() { assert_eq!( paths::somewhere::aaa(), std::path::Path::new("somewhere/asht"), ); assert_eq!( paths::somewhere::aaa::bbb::not_empty_2(), std::path::Path::new("somewhere/asht/neoi/a_file.txt"), ); } }