mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 12:37:49 +00:00
Merge pull request #2557 from miDeb/chgrp/no-err
chgrp: don't output an empty error
This commit is contained in:
commit
db7773eddc
2 changed files with 19 additions and 1 deletions
|
@ -363,7 +363,9 @@ impl Chgrper {
|
||||||
self.verbosity.clone(),
|
self.verbosity.clone(),
|
||||||
) {
|
) {
|
||||||
Ok(n) => {
|
Ok(n) => {
|
||||||
|
if !n.is_empty() {
|
||||||
show_error!("{}", n);
|
show_error!("{}", n);
|
||||||
|
}
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
|
|
@ -229,6 +229,22 @@ fn test_big_h() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
fn basic_succeeds() {
|
||||||
|
let (at, mut ucmd) = at_and_ucmd!();
|
||||||
|
let one_group = nix::unistd::getgroups().unwrap();
|
||||||
|
// if there are no groups we can't run this test.
|
||||||
|
if let Some(group) = one_group.first() {
|
||||||
|
at.touch("f1");
|
||||||
|
ucmd.arg(group.as_raw().to_string())
|
||||||
|
.arg("f1")
|
||||||
|
.succeeds()
|
||||||
|
.no_stdout()
|
||||||
|
.no_stderr();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_no_change() {
|
fn test_no_change() {
|
||||||
let (at, mut ucmd) = at_and_ucmd!();
|
let (at, mut ucmd) = at_and_ucmd!();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue