1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

install: add tests for error handling

This commit is contained in:
ndd7xv 2022-02-25 21:17:43 -05:00
parent 172be3a8c6
commit 47be40afae

View file

@ -1100,3 +1100,27 @@ fn test_install_backup_off() {
assert!(at.file_exists(file_b));
assert!(!at.file_exists(&format!("{}~", file_b)));
}
#[test]
fn test_install_missing_arguments() {
let scene = TestScenario::new(util_name!());
scene
.ucmd()
.fails()
.stderr_contains("install: missing file operand");
}
#[test]
fn test_install_missing_destination() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
let file_1 = "source_file1";
at.touch(file_1);
scene.ucmd().arg(file_1).fails().stderr_contains(format!(
"install: missing destination file operand after '{}'",
file_1
));
}