Skip to content

Commit 0d9d919

Browse files
Luv-Raysylvestre
authored andcommitted
windows test
1 parent 31882f0 commit 0d9d919

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

tests/by-util/test_cp.rs

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5718,8 +5718,6 @@ fn test_copy_symlink_overwrite() {
57185718
} else {
57195719
"cp: will not overwrite just-created 'c\\1' with 'b/1'\n"
57205720
});
5721-
5722-
assert_eq!(at.read("a/1"), "hello");
57235721
}
57245722

57255723
#[test]
@@ -5731,16 +5729,23 @@ fn test_symlink_mode_overwrite() {
57315729
at.write("a/t", "hello");
57325730
at.write("b/t", "hello");
57335731

5734-
ucmd.arg("-s")
5735-
.arg("a/t")
5736-
.arg("b/t")
5737-
.arg(".")
5738-
.fails()
5739-
.stderr_only(if cfg!(not(target_os = "windows")) {
5740-
"cp: will not overwrite just-created './t' with 'b/t'\n"
5741-
} else {
5742-
"cp: will not overwrite just-created '.\\t' with 'b/t'\n"
5743-
});
5732+
if cfg!(not(target_os = "windows")) {
5733+
ucmd.arg("-s")
5734+
.arg("a/t")
5735+
.arg("b/t")
5736+
.arg(".")
5737+
.fails()
5738+
.stderr_only("cp: will not overwrite just-created './t' with 'b/t'\n");
57445739

5745-
assert_eq!(at.read("t"), "hello");
5740+
assert_eq!(at.read("./t"), "hello");
5741+
} else {
5742+
ucmd.arg("-s")
5743+
.arg("a\\t")
5744+
.arg("b\\t")
5745+
.arg(".")
5746+
.fails()
5747+
.stderr_only("cp: will not overwrite just-created '.\\t' with 'b\\t'\n");
5748+
5749+
assert_eq!(at.read(".\\t"), "hello");
5750+
}
57465751
}

0 commit comments

Comments
 (0)