mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 06:30:08 +02:00
Return error when moving a source directory to a target directory which contains a subdirectory with the same name as the source (#6284)
Fixes #6275 Signed-off-by: nibon7 <nibon7@163.com>
This commit is contained in:
@ -375,3 +375,21 @@ fn mv_ignores_ansi() {
|
||||
assert_eq!(actual.out, "success.txt");
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mv_directory_with_same_name() {
|
||||
Playground::setup("mv_test_directory_with_same_name", |_dirs, sandbox| {
|
||||
sandbox.mkdir("testdir");
|
||||
sandbox.mkdir("testdir/testdir");
|
||||
|
||||
let cwd = sandbox.cwd().join("testdir");
|
||||
let actual = nu!(
|
||||
cwd,
|
||||
r#"
|
||||
mv testdir ..
|
||||
"#
|
||||
);
|
||||
|
||||
assert!(actual.err.contains("Directory not empty"));
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user