1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! # fstest
//! `fstest` provides a procedural macro attribute for simplifying integration tests involving
//! temporary file system setups and optional Git repository initialization.
//! This crate defines the `#[fstest]` macro, which wraps a test function and handles:
//! - Creation of a temporary working directory
//! - Optional initialization of a Git repository in the temporary directory
//! - Copying of specified input files into the temp directory
//! - Restoring the original working directory after test execution
//! ## Usage
//!
//! ```rust
//! use fstest::fstest;
//! use std::path::Path;
//!
//! #[fstest(repo = true, files = ["tests/data/input.txt", "tests/data/config.toml"])]
//! fn my_test(tempdir: &Path) {
//! // test code working within `tempdir`
//! }
//!
//! #[fstest(repo = true, tokio = true, files = ["tests/data/input.txt", "tests/data/config.toml"])]
//! async fn my_test(tempdir: &Path) {
//! // test code working within `tempdir`
//! }
//! ```
pub use fstest;
pub use serial_test;
pub use tempfile;
use ;
use ;
/// Creates a new git repository in the given directory and makes an initial commit with all files in the repository.
/// If there is no user configured, it sets a default user name and email.
/// This function is used for setting up a new git repository for testing purposes.