Add test for copying dangling symlink copy with dereference

Signed-off-by: anastygnome <noreplygitemail@protonmail.com>
This commit is contained in:
anastygnome
2022-05-03 19:54:13 +02:00
parent badf947f8a
commit 70c451fa61
+12
View File
@@ -1506,6 +1506,18 @@ fn test_copy_through_dangling_symlink() {
.stderr_only("cp: not writing through dangling symlink 'target'");
}
#[test]
fn test_copy_through_dangling_symlink_no_dereference() {
let (at, mut ucmd) = at_and_ucmd!();
at.symlink_file("no-such-file", "dangle");
ucmd.arg("-P")
.arg("dangle")
.arg("d2")
.succeeds()
.no_stderr()
.no_stdout();
}
#[test]
#[cfg(unix)]
fn test_cp_archive_on_nonexistent_file() {