testfile

Crates.iotestfile
lib.rstestfile
version0.1.5
sourcesrc
created_at2020-06-11 16:48:27.37446
updated_at2024-06-26 07:08:26.073233
descriptionTemporary test file management for unit tests
homepagehttps://gitlab.com/hsn10/testfile
repositoryhttps://gitlab.com/hsn10/testfile.git
max_upload_size
id252849
size20,324
Radim Kolar (hsn10)

documentation

README

testfile for Rust unit tests

License: MIT Crates.io dependency status Documentation Lines of code Gitlab pipeline Downloads

Library for creating automaticaly deleted test files for use in your Rust unit tests. Do not worry about manual temporary file cleanups.

Managed temporary files 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.

Nightly Rust is not required.

Implemented traits for TestFile

  1. Testfile can be dereferenced as File making it drop in replacement.
  2. implements AsRef / AsMut for Read, Write, File, PathBuf, Path.
  3. implements From String and PathBuf.
Commit count: 118

cargo fmt