mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
chgrp: don't output an empty error
This commit is contained in:
@@ -364,7 +364,9 @@ impl Chgrper {
|
||||
self.verbosity.clone(),
|
||||
) {
|
||||
Ok(n) => {
|
||||
show_error!("{}", n);
|
||||
if !n.is_empty() {
|
||||
show_error!("{}", n);
|
||||
}
|
||||
0
|
||||
}
|
||||
Err(e) => {
|
||||
|
||||
@@ -228,3 +228,19 @@ 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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user