mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
tests/ln: add test for same file
This commit is contained in:
parent
4db08273b3
commit
0ab0f2761f
1 changed files with 13 additions and 0 deletions
|
@ -702,3 +702,16 @@ fn test_hard_logical_dir_fail() {
|
||||||
.fails()
|
.fails()
|
||||||
.stderr_contains("failed to link 'link-to-dir'");
|
.stderr_contains("failed to link 'link-to-dir'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_symlink_remove_existing_same_src_and_dest() {
|
||||||
|
let (at, mut ucmd) = at_and_ucmd!();
|
||||||
|
at.touch("a");
|
||||||
|
at.write("a", "sample");
|
||||||
|
ucmd.args(&["-sf", "a", "a"])
|
||||||
|
.fails()
|
||||||
|
.code_is(1)
|
||||||
|
.stderr_contains("Same file");
|
||||||
|
assert!(at.file_exists("a") && !at.symlink_exists("a"));
|
||||||
|
assert_eq!(at.read("a"), "sample");
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue