mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 09:48:03 +00:00
cp: add a test for #2631
This commit is contained in:
parent
ef9c5d4fcf
commit
6a6da71403
1 changed files with 15 additions and 0 deletions
|
@ -7,6 +7,8 @@ use std::fs::set_permissions;
|
|||
#[cfg(not(windows))]
|
||||
use std::os::unix::fs;
|
||||
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::fs::symlink as symlink_file;
|
||||
#[cfg(unix)]
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
#[cfg(windows)]
|
||||
|
@ -1353,3 +1355,16 @@ fn test_preserve_mode() {
|
|||
PERMS_ALL
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_canonicalize_symlink() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
at.mkdir("dir");
|
||||
at.touch("dir/file");
|
||||
symlink_file("../dir/file", at.plus("dir/file-ln")).unwrap();
|
||||
ucmd.arg("dir/file-ln")
|
||||
.arg(".")
|
||||
.succeeds()
|
||||
.no_stderr()
|
||||
.no_stdout();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue