Skip write_error test if running as root (#1881)

This commit is contained in:
Casey Rodarmor 2024-01-26 13:18:51 -08:00 committed by GitHub
parent 5a36e685e5
commit d55b5c2bdd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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' ",
};