Module setup

Module setup 

Source

Functionsยง

create_dir_all
Create a directory path if it does not exist. Will not throw an error if the directory already exists. Use to guarantee the filesystem state before a test runs.
get_file_contents
Read the contents of a file into a vector of bytes. Use for fixtures you never want to change.
get_rc_ref_cell_empty_vec
Get an empty vector wrapped in an Rc<RefCell<>>.
get_read_and_write_file
Get a read and write file handle. Use this to create temporary files for testing and comparison. The file will be created if it does not exist, and it will be overridden if it does.
get_read_only_file
Get a read-only file handle. Use for fixtures you never want to change.
get_reader_for_file
Get a BufReader for a file. Use for fixtures you never want to change.
get_writer_for_file
Get a writer for a file, creating the file if it does not exist. Use this to create temporary files for testing and comparison.
remove_file
Remove a file if it exists. Will not throw an error if the file does not exist.
sequential
Allow tests with side-effects to run without interfering with each other. The lock is released when the MutexGuard variable goes out of scope. Will ignore poison errors from other tests so that our test can continue even if theirs fails.
write_file_contents
Write bytes to a file, creating the file if it does not exist.