Skip to content

Commit 2a044db

Browse files
authored
cp: Fixed POSIXLY_CORRECT test to actually check if file exists and its contents (uutils#10247)
cp: Added check of file contents in POSIXLY_CORRECT test cp: Fixed windows test by including path cp: Updated test
1 parent 038a08b commit 2a044db

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/by-util/test_cp.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2991,11 +2991,15 @@ fn test_copy_through_dangling_symlink() {
29912991
fn test_copy_through_dangling_symlink_posixly_correct() {
29922992
let (at, mut ucmd) = at_and_ucmd!();
29932993
at.touch("file");
2994+
at.write("file", "content");
29942995
at.symlink_file("nonexistent", "target");
29952996
ucmd.arg("file")
29962997
.arg("target")
29972998
.env("POSIXLY_CORRECT", "1")
29982999
.succeeds();
3000+
assert!(at.file_exists("nonexistent"));
3001+
let contents = at.read("nonexistent");
3002+
assert_eq!(contents, "content");
29993003
}
30003004

30013005
#[test]

0 commit comments

Comments
 (0)