Skip to content

Commit

Permalink
test: properly mark no-Windows test
Browse files Browse the repository at this point in the history
  • Loading branch information
nc7s committed Nov 13, 2023
1 parent 100db82 commit 9f0c476
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<P: AsRef<std::path::Path>>(
src: &P,
dst: &P,
) -> Result<()> {
#[cfg(target_family = "unix")]
std::os::unix::fs::symlink(src, dst)?;

Ok(())
Expand Down Expand Up @@ -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()?;
Expand Down

0 comments on commit 9f0c476

Please sign in to comment.