1
0
mirror of https://github.com/j178/prek.git synced 2026-04-25 02:11:36 +02:00

test: skip symlink tests if create symlink failed (#1562)

- Added is_elevated crate to [target.'cfg(windows)'.dependencies]
- Required to check for admin privileges before running symlink tests

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
This commit is contained in:
박찬규
2026-02-05 17:41:32 +09:00
committed by GitHub
parent f4dd26e34f
commit 691bdd89b2
@@ -91,7 +91,10 @@ mod tests {
let link_path = dir.path().join("link.txt");
// Windows requires different APIs for file vs directory symlinks
tokio::fs::symlink_file(&target, &link_path).await?;
if tokio::fs::symlink_file(&target, &link_path).await.is_err() {
// Skipping test: insufficient permissions for symlink creation on Windows
return Ok(());
}
let (code, output) = check_file(Path::new(""), &link_path).await?;
assert_eq!(code, 0);