From 4d6014071a4e86d088db1211ab108ef24f923d7b Mon Sep 17 00:00:00 2001 From: Erlend Langseth <3rlendhl@gmail.com> Date: Sat, 14 May 2022 11:35:24 +0200 Subject: [PATCH] Fix one test that failed in Windows --- src/suffix.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/suffix.rs b/src/suffix.rs index 6ba1b49..aded72b 100644 --- a/src/suffix.rs +++ b/src/suffix.rs @@ -363,6 +363,11 @@ mod test { let paths = suffix_scheme.scan_suffixes(relative_path); assert_eq!(paths.len(), 2); + // Reset CWD: necessary on Windows only - otherwise we get the error: + // "The process cannot access the file because it is being used by another process." + // (code 32) + std::env::set_current_dir("/").unwrap(); + // Cleanup std::fs::remove_dir_all(&working_dir).unwrap(); }