Macro testdir::init_testdir

source ·
macro_rules! init_testdir {
    () => { ... };
}
Expand description

Initialises the global NumberedDir used by the testdir macro.

This macro is implicitly called by the testdir macro to initialise the global NumberedDir instance inside the cargo target directory. It must be called before any call to with_testdir to ensure this is initialised.

Examples

use testdir::{init_testdir, with_testdir};

init_testdir!();
let path = with_testdir(|dir| dir.create_subdir("some/subdir").unwrap());
assert!(path.is_dir());
assert!(path.ends_with("some/subdir"));