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

mv --backup=simple a b on hard links should not fail

touch a
ln a b
./target/debug/coreutils mv --backup=simple a b

GNU: tests/mv/hard-4.sh
This commit is contained in:
Sylvestre Ledru 2023-05-06 12:50:58 +02:00
parent 1b99376d95
commit 594f81a88a
2 changed files with 20 additions and 1 deletions

View file

@ -417,6 +417,23 @@ fn test_mv_same_hardlink() {
.stderr_is(format!("mv: '{file_a}' and '{file_b}' are the same file\n",));
}
#[test]
#[cfg(unix)]
fn test_mv_same_hardlink_backup_simple() {
let (at, mut ucmd) = at_and_ucmd!();
let file_a = "test_mv_same_file_a";
let file_b = "test_mv_same_file_b";
at.touch(file_a);
at.hard_link(file_a, file_b);
at.touch(file_a);
ucmd.arg(file_a)
.arg(file_b)
.arg("--backup=simple")
.succeeds();
}
#[test]
fn test_mv_same_file_not_dot_dir() {
let (at, mut ucmd) = at_and_ucmd!();