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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user