attempts to allow the test to work when run as root (#5601)

This commit is contained in:
pwygab 2022-05-21 10:48:36 +08:00 committed by GitHub
parent a3a9571dac
commit 7c63ce15d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -259,9 +259,20 @@ fn fails_with_ls_to_dir_without_permission() {
chmod 000 dir_a; ls dir_a
"#
));
assert!(actual
.err
.contains("The permissions of 0 do not allow access for this user"));
let check_not_root = nu!(
cwd: dirs.test(), pipeline(
r#"
id -u
"#
));
assert!(
actual
.err
.contains("The permissions of 0 do not allow access for this user")
|| check_not_root.out == "0"
);
})
}