mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
install: add tests for error handling
This commit is contained in:
parent
172be3a8c6
commit
47be40afae
1 changed files with 24 additions and 0 deletions
|
@ -1100,3 +1100,27 @@ fn test_install_backup_off() {
|
||||||
assert!(at.file_exists(file_b));
|
assert!(at.file_exists(file_b));
|
||||||
assert!(!at.file_exists(&format!("{}~", 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
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue