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

tests/ln: fix tests according to new messages

This commit is contained in:
Niyaz Nigmatullin 2022-07-18 23:52:31 +03:00
parent 80ff3b3b40
commit 406d3931e9

View file

@ -622,7 +622,7 @@ fn test_backup_same_file() {
at.touch("file1"); at.touch("file1");
ucmd.args(&["--backup", "file1", "./file1"]) ucmd.args(&["--backup", "file1", "./file1"])
.fails() .fails()
.stderr_contains("n: failed to link 'file1' to './file1': Same file"); .stderr_contains("n: 'file1' and './file1' are the same file");
} }
#[test] #[test]
@ -676,14 +676,13 @@ fn test_hard_logical_non_exit_fail() {
let file_a = "/no-such-dir"; let file_a = "/no-such-dir";
let link = "hard-to-dangle"; let link = "hard-to-dangle";
scene.ucmd().args(&["-s", file_a]); at.relative_symlink_dir(file_a, "no-such-dir");
assert!(!at.is_symlink("no-such-dir"));
scene scene
.ucmd() .ucmd()
.args(&["-L", "no-such-dir", link]) .args(&["-L", "no-such-dir", link])
.fails() .fails()
.stderr_contains("failed to link 'no-such-dir'"); .stderr_contains("failed to access 'no-such-dir'");
} }
#[test] #[test]
@ -700,7 +699,7 @@ fn test_hard_logical_dir_fail() {
.ucmd() .ucmd()
.args(&["-L", target, "hard-to-dir-link"]) .args(&["-L", target, "hard-to-dir-link"])
.fails() .fails()
.stderr_contains("failed to link 'link-to-dir'"); .stderr_contains("failed to create hard link 'link-to-dir'");
} }
#[test] #[test]
@ -711,7 +710,7 @@ fn test_symlink_remove_existing_same_src_and_dest() {
ucmd.args(&["-sf", "a", "a"]) ucmd.args(&["-sf", "a", "a"])
.fails() .fails()
.code_is(1) .code_is(1)
.stderr_contains("Same file"); .stderr_contains("'a' and 'a' are the same file");
assert!(at.file_exists("a") && !at.symlink_exists("a")); assert!(at.file_exists("a") && !at.symlink_exists("a"));
assert_eq!(at.read("a"), "sample"); assert_eq!(at.read("a"), "sample");
} }