[−][src]Macro testdir::init_testdir
Initialises the global NumberedDir
used by the testdir
macro.
This macro is implicitly called by the testdir
macro to initialise the global
NumberedDir
instance with a base of the Cargo package name calling the macro.
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"));