mirror of
https://github.com/uutils/coreutils
synced 2024-10-15 12:24:09 +00:00
du: adapt error msg to match GNU's
This commit is contained in:
parent
a5e611eb06
commit
d1e1e9ce0f
|
@ -785,8 +785,8 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
|||
.send(Err(USimpleError::new(
|
||||
1,
|
||||
format!(
|
||||
"{}: No such file or directory",
|
||||
path.to_string_lossy().maybe_quote()
|
||||
"cannot access {}: No such file or directory",
|
||||
path.to_string_lossy().quote()
|
||||
),
|
||||
)))
|
||||
.map_err(|e| USimpleError::new(1, e.to_string()))?;
|
||||
|
|
|
@ -173,11 +173,15 @@ fn test_du_with_posixly_correct() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn test_du_basics_bad_name() {
|
||||
fn test_du_non_existing_files() {
|
||||
new_ucmd!()
|
||||
.arg("bad_name")
|
||||
.arg("non_existing_a")
|
||||
.arg("non_existing_b")
|
||||
.fails()
|
||||
.stderr_only("du: bad_name: No such file or directory\n");
|
||||
.stderr_only(concat!(
|
||||
"du: cannot access 'non_existing_a': No such file or directory\n",
|
||||
"du: cannot access 'non_existing_b': No such file or directory\n"
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in a new issue