From 9f0c476b09486ca54fad6d75d18e2a9efc2c902f Mon Sep 17 00:00:00 2001 From: Blair Noctis Date: Fri, 10 Nov 2023 17:43:00 +0800 Subject: [PATCH] test: properly mark no-Windows test --- tests/cli.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/cli.rs b/tests/cli.rs index 98dfed9..03b5491 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -13,11 +13,14 @@ mod cli { assert_eq!(content, std::fs::read_to_string(path).unwrap()); } - #[cfg(target_family = "unix")] + // This should really be cfg_attr(target_family = "windows"), but wasi impl + // is nightly for now, and other impls are not part of std + #[cfg_attr(not(target_family = "unix"), ignore = "Windows symlinks are privileged")] fn create_soft_link>( src: &P, dst: &P, ) -> Result<()> { + #[cfg(target_family = "unix")] std::os::unix::fs::symlink(src, dst)?; Ok(()) @@ -51,7 +54,7 @@ mod cli { Ok(()) } - #[cfg(target_family = "unix")] + #[cfg_attr(target_family = "windows", ignore = "Windows symlinks are privileged")] #[test] fn in_place_following_symlink() -> Result<()> { let dir = tempfile::tempdir()?;