1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-02 22:17:45 +00:00

Merge pull request #2427 from miDeb/ln/recursive-relative

ln: don't return an empty path in `relative_path`
This commit is contained in:
Sylvestre Ledru 2021-06-19 12:03:59 +02:00 committed by GitHub
commit ac98960f32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -580,3 +580,11 @@ fn test_relative_src_already_symlink() {
ucmd.arg("-sr").arg("file2").arg("file3").succeeds();
assert!(at.resolve_link("file3").ends_with("file1"));
}
#[test]
fn test_relative_recursive() {
let (at, mut ucmd) = at_and_ucmd!();
at.mkdir("dir");
ucmd.args(&["-sr", "dir", "dir/recursive"]).succeeds();
assert_eq!(at.resolve_link("dir/recursive"), ".");
}