Skip to content

Commit

Permalink
Skip write_error test if running as root (#1881)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Jan 26, 2024
1 parent 5a36e68 commit d55b5c2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ fn unstable_passed() {

#[test]
fn write_error() {
// skip this test if running as root, since root can write files even if
// permissions would otherwise forbid it
#[cfg(not(windows))]
if unsafe { libc::getuid() } == 0 {
return;
}

let tempdir = temptree! {
justfile: "x := 'hello' ",
};
Expand Down

0 comments on commit d55b5c2

Please sign in to comment.