mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-29 17:55:45 +01:00
craft-xtask: compare canonical paths in the working-directory test
On macOS the temp directory is under /var, a link to /private/var, so current_dir() reads back the /private/var path and the assert failed on main's macOS gate.
This commit is contained in:
1 parent
f83e228e81
commit
6b41fb6814
1 file changed
+3
-1
@@ -2857,7 +2857,9 @@ fn seven() { let _ = "seven"; }
|
||||
let policy = Policy { skip: change_directory, ..POLICY };
|
||||
let found = scan(Path::new("."), &[Input::rust(Path::new("src"))], &policy).unwrap();
|
||||
assert_eq!(hits(&found), [("src/a.rs".to_owned(), 1, "AzureKit")]);
|
||||
assert_eq!(std::env::current_dir().unwrap(), PathBuf::from(root).join("switched"));
|
||||
// Canonical on both sides: macOS temp paths run through the /var -> /private/var link.
|
||||
let canonical = |p: PathBuf| p.canonicalize().unwrap();
|
||||
assert_eq!(canonical(std::env::current_dir().unwrap()), canonical(PathBuf::from(root).join("switched")));
|
||||
return;
|
||||
}
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
|
||||
Reference in new issue
Block a user