mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
install: don't error when multiple arguments of the same type are given, instead override with last one (#8033) (#8053)
This commit is contained in:
parent
46cfeadf7c
commit
3214c4d604
2 changed files with 75 additions and 0 deletions
|
@ -447,6 +447,80 @@ fn test_install_nested_paths_copy_file() {
|
|||
assert!(at.file_exists(format!("{dir2}/{file1}")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_multiple_mode_arguments_override_not_error() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
let dir = "source_dir";
|
||||
|
||||
let file = "source_file";
|
||||
let gid = getegid();
|
||||
let uid = geteuid();
|
||||
|
||||
at.touch(file);
|
||||
at.mkdir(dir);
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
.args(&[
|
||||
file,
|
||||
&format!("{dir}/{file}"),
|
||||
"--owner=invalid_owner",
|
||||
"--owner",
|
||||
&uid.to_string(),
|
||||
])
|
||||
.succeeds()
|
||||
.no_stderr();
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
.args(&[
|
||||
file,
|
||||
&format!("{dir}/{file}"),
|
||||
"-o invalid_owner",
|
||||
"-o",
|
||||
&uid.to_string(),
|
||||
])
|
||||
.succeeds()
|
||||
.no_stderr();
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
.args(&[file, &format!("{dir}/{file}"), "--mode=999", "--mode=200"])
|
||||
.succeeds()
|
||||
.no_stderr();
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
.args(&[file, &format!("{dir}/{file}"), "-m 999", "-m 200"])
|
||||
.succeeds()
|
||||
.no_stderr();
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
.args(&[
|
||||
file,
|
||||
&format!("{dir}/{file}"),
|
||||
"--group=invalid_group",
|
||||
"--group",
|
||||
&gid.to_string(),
|
||||
])
|
||||
.succeeds()
|
||||
.no_stderr();
|
||||
|
||||
scene
|
||||
.ucmd()
|
||||
.args(&[
|
||||
file,
|
||||
&format!("{dir}/{file}"),
|
||||
"-g invalid_group",
|
||||
"-g",
|
||||
&gid.to_string(),
|
||||
])
|
||||
.succeeds()
|
||||
.no_stderr();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_install_failing_omitting_directory() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue