diff --git a/tests/by-util/test_cp.rs b/tests/by-util/test_cp.rs index 2d252c56010..8cb844ce82e 100644 --- a/tests/by-util/test_cp.rs +++ b/tests/by-util/test_cp.rs @@ -2991,11 +2991,15 @@ fn test_copy_through_dangling_symlink() { fn test_copy_through_dangling_symlink_posixly_correct() { let (at, mut ucmd) = at_and_ucmd!(); at.touch("file"); + at.write("file", "content"); at.symlink_file("nonexistent", "target"); ucmd.arg("file") .arg("target") .env("POSIXLY_CORRECT", "1") .succeeds(); + assert!(at.file_exists("nonexistent")); + let contents = at.read("nonexistent"); + assert_eq!(contents, "content"); } #[test]