Crates.io | testfile |
lib.rs | testfile |
version | 0.2.0-alpha.7 |
created_at | 2020-06-11 16:48:27.37446+00 |
updated_at | 2025-05-11 10:11:55.772796+00 |
description | Temporary test file/dir management for unit tests |
homepage | https://gitlab.com/hsn10/testfile |
repository | https://gitlab.com/hsn10/testfile.git |
max_upload_size | |
id | 252849 |
size | 51,878 |
Library for creating automaticaly deleted test files or directories for use in your Rust unit tests. Do not worry about manual temporary file/dir cleanups anymore.
Managed temporary files/directories are created in system temporary directory with unique file names.
They can be dereferenced as ordinary File
and are automatically deleted during Drop
.
Functions do not return Result <T,E>
but panic!
allowing you to focus on your tests and not on error handling.
Because of panic! style error handling its not recommended to use this library outside of unit/integration tests.
AsRef
/ AsMut
for Read, Write, File, PathBuf, Path.From
String, &str, &Path and PathBuf.From
PathBuf, &Path.Runs on MSRV 1.56 including its own unit tests. It can be used on any version of Rust 2021 edition. Compiles and runs on Rust edition 2024 without warnings.
Depends only on small stdrandom crate which is MSRV 1.56 compatible.
Licensed under permissive MIT License.