1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

mv: trigger an error when doing mv dir1 dir2 dir2

This commit is contained in:
Sylvestre Ledru 2022-04-12 22:37:38 +02:00
parent 57b8caf1d0
commit 920633c0ea
2 changed files with 35 additions and 1 deletions

View file

@ -823,6 +823,24 @@ fn test_mv_interactive_error() {
.is_empty());
}
#[test]
fn test_mv_info_self() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
let dir1 = "dir1";
let dir2 = "dir2";
at.mkdir(dir1);
at.mkdir(dir2);
scene
.ucmd()
.arg(dir1)
.arg(dir2)
.arg(dir2)
.fails()
.stderr_contains("mv: cannot move 'dir2' to a subdirectory of itself, 'dir2/dir2'");
}
// Todo:
// $ at.touch a b