Allow cp multiple files at once (#6114)

* Allow cp multiple files at once

* Expand destination with expand_ndots
This commit is contained in:
Matthew Ma
2022-07-25 00:42:25 -07:00
committed by GitHub
parent 46f64c6fdc
commit 87e2fa137a
3 changed files with 91 additions and 29 deletions

View File

@ -17,6 +17,22 @@ fn copies_a_file() {
});
}
#[test]
fn copies_multiple_files() {
Playground::setup("cp_test_1_1", |dirs, sandbox| {
sandbox
.with_files(vec![EmptyFile("a.txt"), EmptyFile("b.txt")])
.mkdir("dest");
nu!(
cwd: dirs.test(),
"cp a.txt b.txt dest",
);
assert!(dirs.test().join("dest/a.txt").exists());
assert!(dirs.test().join("dest/b.txt").exists());
});
}
#[test]
fn copies_the_file_inside_directory_if_path_to_copy_is_directory() {
Playground::setup("cp_test_2", |dirs, _| {