1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 21:47:46 +00:00

Merge pull request #2429 from miDeb/install/target-dir

install: support --target-directory
This commit is contained in:
Sylvestre Ledru 2021-06-24 21:06:44 +02:00 committed by GitHub
commit 5d7cf61128
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 37 additions and 12 deletions

View file

@ -674,3 +674,25 @@ fn test_install_creating_leading_dir_fails_on_long_name() {
.fails()
.stderr_contains("failed to create");
}
#[test]
fn test_install_dir() {
let (at, mut ucmd) = at_and_ucmd!();
let dir = "target_dir";
let file1 = "source_file1";
let file2 = "source_file2";
at.touch(file1);
at.touch(file2);
at.mkdir(dir);
ucmd.arg(file1)
.arg(file2)
.arg(&format!("--target-directory={}", dir))
.succeeds()
.no_stderr();
assert!(at.file_exists(file1));
assert!(at.file_exists(file2));
assert!(at.file_exists(&format!("{}/{}", dir, file1)));
assert!(at.file_exists(&format!("{}/{}", dir, file2)));
}