Skip to content

Commit 1e5ef0e

Browse files
committed
tests: Use git::copy_tracked_files from test-helper
1 parent 846fa7e commit 1e5ef0e

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ walkdir = "2.2.3"
4545
[dev-dependencies]
4646
rustversion = "1"
4747
tempfile = { version = "3", default-features = false }
48-
test-helper = { features = ["cli", "doc", "git"], git = "https://github.com/taiki-e/test-helper.git", rev = "d2272e8" }
48+
test-helper = { features = ["cli", "doc", "git"], git = "https://github.com/taiki-e/test-helper.git", rev = "f38a7f5" }
4949

5050
[lints]
5151
workspace = true

tests/auxiliary/mod.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,7 @@ pub(crate) fn normalize_output(output_path: &Path, args: &[&str]) {
121121
#[track_caller]
122122
pub(crate) fn test_project(model: &str) -> tempfile::TempDir {
123123
let tmpdir = tempfile::tempdir().unwrap();
124-
let workspace_root = tmpdir.path();
125-
let model_path = fixtures_dir().join("crates").join(model);
126-
127-
for (file_name, from) in test_helper::git::ls_files(model_path, &[]) {
128-
let to = &workspace_root.join(file_name);
129-
if !to.parent().unwrap().is_dir() {
130-
fs::create_dir_all(to.parent().unwrap()).unwrap();
131-
}
132-
fs::copy(from, to).unwrap();
133-
}
134-
124+
test_helper::git::copy_tracked_files(fixtures_dir().join("crates").join(model), tmpdir.path());
135125
tmpdir
136126
}
137127

0 commit comments

Comments
 (0)