mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
cp: --rem don't fail if dest is symlink to source
This commit is contained in:
parent
f971a69d69
commit
772892e2e4
2 changed files with 24 additions and 0 deletions
|
@ -2827,6 +2827,22 @@ fn test_cp_mode_hardlink_no_dereference() {
|
|||
assert_eq!(at.read_symlink("z"), "slink");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_remove_destination_with_destination_being_a_symlink_to_source() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
let file = "file";
|
||||
let symlink = "symlink";
|
||||
|
||||
at.touch(file);
|
||||
at.symlink_file(file, symlink);
|
||||
|
||||
ucmd.args(&["--remove-destination", file, symlink])
|
||||
.succeeds();
|
||||
assert!(!at.symlink_exists(symlink));
|
||||
assert!(at.file_exists(file));
|
||||
assert!(at.file_exists(symlink));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_remove_destination_symbolic_link_loop() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue