mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Merge pull request #3671 from niyaznigmatullin/fix_realpath_test
test_realpath: fixed test to be the one that was supposed to be
This commit is contained in:
commit
43a5b8c7d7
2 changed files with 37 additions and 4 deletions
|
@ -219,7 +219,7 @@ fn test_realpath_when_symlink_is_absolute_and_enoent() {
|
|||
at.mkdir("dir1");
|
||||
at.symlink_file("dir2/bar", "dir1/foo1");
|
||||
at.symlink_file("/dir2/bar", "dir1/foo2");
|
||||
at.relative_symlink_file("dir2/baz", at.plus("dir1/foo3").to_str().unwrap());
|
||||
at.relative_symlink_file("../dir2/baz", "dir1/foo3");
|
||||
|
||||
#[cfg(unix)]
|
||||
ucmd.arg("dir1/foo1")
|
||||
|
@ -228,7 +228,7 @@ fn test_realpath_when_symlink_is_absolute_and_enoent() {
|
|||
.run()
|
||||
.stdout_contains("/dir2/bar\n")
|
||||
.stdout_contains("/dir2/baz\n")
|
||||
.stderr_is("realpath: dir1/foo2: No such file or directory");
|
||||
.stderr_is("realpath: dir1/foo2: No such file or directory\n");
|
||||
|
||||
#[cfg(windows)]
|
||||
ucmd.arg("dir1/foo1")
|
||||
|
@ -239,3 +239,25 @@ fn test_realpath_when_symlink_is_absolute_and_enoent() {
|
|||
.stdout_contains("\\dir2\\baz\n")
|
||||
.stderr_is("realpath: dir1/foo2: No such file or directory");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "issue #3669"]
|
||||
fn test_realpath_when_symlink_part_is_missing() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
|
||||
at.mkdir("dir2");
|
||||
at.touch("dir2/bar");
|
||||
|
||||
at.mkdir("dir1");
|
||||
at.relative_symlink_file("../dir2/bar", "dir1/foo1");
|
||||
at.relative_symlink_file("dir2/bar", "dir1/foo2");
|
||||
at.relative_symlink_file("../dir2/baz", "dir1/foo3");
|
||||
at.symlink_file("dir3/bar", "dir1/foo4");
|
||||
|
||||
ucmd.args(&["dir1/foo1", "dir1/foo2", "dir1/foo3", "dir1/foo4"])
|
||||
.run()
|
||||
.stdout_contains(at.plus_as_string("dir2/bar") + "\n")
|
||||
.stdout_contains(at.plus_as_string("dir2/baz") + "\n")
|
||||
.stderr_contains("realpath: dir1/foo2: No such file or directory\n")
|
||||
.stderr_contains("realpath: dir1/foo4: No such file or directory\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue