1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

cp: only allow directory for -t

This commit is contained in:
Sam Caldwell 2022-02-01 20:26:33 -07:00 committed by Sylvestre Ledru
parent d6c1b7fa91
commit efd627bb20
2 changed files with 16 additions and 0 deletions

View file

@ -183,6 +183,16 @@ fn test_cp_arg_no_target_directory() {
.stderr_contains("cannot overwrite directory");
}
#[test]
fn test_cp_target_directory_is_file() {
new_ucmd!()
.arg("-t")
.arg(TEST_HOW_ARE_YOU_SOURCE)
.arg(TEST_HELLO_WORLD_SOURCE)
.fails()
.stderr_contains("must specify a directory");
}
#[test]
fn test_cp_arg_interactive() {
new_ucmd!()