1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Fix the windows tests

This commit is contained in:
Sylvestre Ledru 2023-12-24 15:18:31 +01:00
parent ceecac110c
commit 15573579cc
3 changed files with 39 additions and 25 deletions

View file

@ -3571,12 +3571,15 @@ fn test_cp_seen_file() {
at.write("a/f", "a"); at.write("a/f", "a");
at.write("b/f", "b"); at.write("b/f", "b");
ts.ucmd() let result = ts.ucmd().arg("a/f").arg("b/f").arg("c").fails();
.arg("a/f") #[cfg(not(unix))]
.arg("b/f") assert!(result
.arg("c") .stderr_str()
.fails() .contains("will not overwrite just-created 'c\\f' with 'b/f'"));
.stderr_contains("will not overwrite just-created 'c/f' with 'b/f'"); #[cfg(unix)]
assert!(result
.stderr_str()
.contains("will not overwrite just-created 'c/f' with 'b/f'"));
assert!(at.plus("c").join("f").exists()); assert!(at.plus("c").join("f").exists());

View file

@ -733,12 +733,16 @@ fn test_ln_seen_file() {
at.write("a/f", "a"); at.write("a/f", "a");
at.write("b/f", "b"); at.write("b/f", "b");
ts.ucmd() let result = ts.ucmd().arg("a/f").arg("b/f").arg("c").fails();
.arg("a/f")
.arg("b/f") #[cfg(not(unix))]
.arg("c") assert!(result
.fails() .stderr_str()
.stderr_contains("will not overwrite just-created 'c/f' with 'b/f'"); .contains("will not overwrite just-created 'c\\f' with 'b/f'"));
#[cfg(unix)]
assert!(result
.stderr_str()
.contains("will not overwrite just-created 'c/f' with 'b/f'"));
assert!(at.plus("c").join("f").exists()); assert!(at.plus("c").join("f").exists());
// b/f still exists // b/f still exists

View file

@ -1480,12 +1480,16 @@ fn test_mv_seen_file() {
at.write("a/f", "a"); at.write("a/f", "a");
at.write("b/f", "b"); at.write("b/f", "b");
ts.ucmd() let result = ts.ucmd().arg("a/f").arg("b/f").arg("c").fails();
.arg("a/f")
.arg("b/f") #[cfg(not(unix))]
.arg("c") assert!(result
.fails() .stderr_str()
.stderr_contains("will not overwrite just-created 'c/f' with 'b/f'"); .contains("will not overwrite just-created 'c\\f' with 'b/f'"));
#[cfg(unix)]
assert!(result
.stderr_str()
.contains("will not overwrite just-created 'c/f' with 'b/f'"));
// a/f has been moved into c/f // a/f has been moved into c/f
assert!(at.plus("c").join("f").exists()); assert!(at.plus("c").join("f").exists());
@ -1507,13 +1511,16 @@ fn test_mv_seen_multiple_files_to_directory() {
at.write("b/f", "b"); at.write("b/f", "b");
at.write("b/g", "g"); at.write("b/g", "g");
ts.ucmd() let result = ts.ucmd().arg("a/f").arg("b/f").arg("b/g").arg("c").fails();
.arg("a/f") #[cfg(not(unix))]
.arg("b/f") assert!(result
.arg("b/g") .stderr_str()
.arg("c") .contains("will not overwrite just-created 'c\\f' with 'b/f'"));
.fails() #[cfg(unix)]
.stderr_contains("will not overwrite just-created 'c/f' with 'b/f'"); assert!(result
.stderr_str()
.contains("will not overwrite just-created 'c/f' with 'b/f'"));
assert!(!at.plus("a").join("f").exists()); assert!(!at.plus("a").join("f").exists());
assert!(at.plus("b").join("f").exists()); assert!(at.plus("b").join("f").exists());
assert!(!at.plus("b").join("g").exists()); assert!(!at.plus("b").join("g").exists());