1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

df: show error when file argument does not exist

For example:

    $ df not-a-file
    df: not-a-file: No such file or directory

Fixes #3373.
This commit is contained in:
Jeffrey Finkelstein 2022-04-09 00:17:32 -04:00 committed by jfinkels
parent c5413167e2
commit 460bd67050
2 changed files with 32 additions and 6 deletions

View file

@ -297,3 +297,16 @@ fn test_output_field_no_more_than_once() {
.fails()
.usage_error("option --output: field 'target' used more than once");
}
#[test]
fn test_nonexistent_file() {
new_ucmd!()
.arg("does-not-exist")
.fails()
.stderr_only("df: does-not-exist: No such file or directory");
new_ucmd!()
.args(&["--output=file", "does-not-exist", "."])
.fails()
.stderr_is("df: does-not-exist: No such file or directory\n")
.stdout_is("File \n. \n");
}