1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 11:36:16 +00:00

Merge pull request #4905 from sylvestre/mv-n

mv: Show 'skipped' when a file isn't overwriten
This commit is contained in:
Daniel Hofstetter 2023-05-30 07:27:48 +02:00 committed by GitHub
commit 191f2380b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 4 deletions

View file

@ -1243,6 +1243,29 @@ fn test_mv_info_self() {
.stderr_contains("mv: cannot move 'dir2' to a subdirectory of itself, 'dir2/dir2'");
}
#[test]
fn test_mv_arg_interactive_skipped() {
let (at, mut ucmd) = at_and_ucmd!();
at.touch("a");
at.touch("b");
ucmd.args(&["-vi", "a", "b"])
.pipe_in("N\n")
.ignore_stdin_write_error()
.fails()
.stderr_is("mv: overwrite 'b'? ")
.stdout_is("skipped 'b'\n");
}
#[test]
fn test_mv_arg_interactive_skipped_vin() {
let (at, mut ucmd) = at_and_ucmd!();
at.touch("a");
at.touch("b");
ucmd.args(&["-vin", "a", "b"])
.fails()
.stdout_is("skipped 'b'\n");
}
#[test]
fn test_mv_into_self_data() {
let scene = TestScenario::new(util_name!());