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

chore: add non-regression tests for cp arg count

This commit is contained in:
LoricAndre 2024-09-10 12:20:45 +02:00
parent 5b1d4d9bdc
commit 399384062d

View file

@ -5751,3 +5751,20 @@ fn test_cp_with_options_backup_and_rem_when_dest_is_symlink() {
assert!(!at.symlink_exists("inner_dir/sl")); assert!(!at.symlink_exists("inner_dir/sl"));
assert_eq!(at.read("inner_dir/sl"), "xyz"); assert_eq!(at.read("inner_dir/sl"), "xyz");
} }
#[test]
fn test_cp_single_file() {
let (_at, mut ucmd) = at_and_ucmd!();
ucmd.arg(TEST_HELLO_WORLD_SOURCE)
.fails()
.code_is(1)
.stderr_contains("missing destination file");
}
#[test]
fn test_cp_no_file() {
let (_at, mut ucmd) = at_and_ucmd!();
ucmd.fails()
.code_is(1)
.stderr_contains("error: the following required arguments were not provided:");
}