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

cp: Error out if cp only contains source

This commit is contained in:
David Matos 2023-09-05 23:35:14 +02:00
parent f71a7bc0c4
commit 8be6338da9
2 changed files with 15 additions and 0 deletions

View file

@ -3231,3 +3231,15 @@ fn test_cp_debug_sparse_always_reflink_auto() {
panic!("Failure: stdout was \n{stdout_str}");
}
}
#[test]
fn test_cp_only_source_no_target() {
let ts = TestScenario::new(util_name!());
let at = &ts.fixtures;
at.touch("a");
let result = ts.ucmd().arg("a").fails();
let stderr_str = result.stderr_str();
if !stderr_str.contains("missing destination file operand after \"a\"") {
panic!("Failure: stderr was \n{stderr_str}");
}
}