forked from extern/nushell
fix: fixcd (#6799)
* fix: fixcd try to fix Log: try to fix the bug with can enter a permisson error fold * change wording * fat * fmt Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
This commit is contained in:
@ -289,3 +289,43 @@ fn test_change_windows_drive() {
|
||||
.exists());
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
#[test]
|
||||
fn cd_permission_deined_folder() {
|
||||
Playground::setup("cd_test_21", |dirs, sandbox| {
|
||||
sandbox.mkdir("banned");
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(),
|
||||
r#"
|
||||
chmod -x banned
|
||||
cd banned
|
||||
"#
|
||||
);
|
||||
assert!(actual.err.contains("Cannot change directory to"));
|
||||
nu!(
|
||||
cwd: dirs.test(),
|
||||
r#"
|
||||
chmod +x banned
|
||||
rm banned
|
||||
"#
|
||||
);
|
||||
});
|
||||
}
|
||||
// FIXME: cd_permission_deined_folder on windows
|
||||
#[ignore]
|
||||
#[cfg(windows)]
|
||||
#[test]
|
||||
fn cd_permission_deined_folder() {
|
||||
Playground::setup("cd_test_21", |dirs, sandbox| {
|
||||
sandbox.mkdir("banned");
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(),
|
||||
r#"
|
||||
icacls banned /deny BUILTIN\Administrators:F
|
||||
cd banned
|
||||
"#
|
||||
);
|
||||
assert!(actual.err.contains("Folder is not able to read"));
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user