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

du: use "parse_size" from uucore

* fix stderr to be the same than GNU's `du` in case of invalid SIZE
This commit is contained in:
Jan Scheer 2021-05-31 15:22:37 +02:00
parent 3a6605844f
commit f9a088cecf
2 changed files with 45 additions and 73 deletions

View file

@ -71,6 +71,23 @@ fn _du_basics_subdir(s: &str) {
}
}
#[test]
fn test_du_invalid_size() {
new_ucmd!()
.arg("--block-size=1fb4t")
.arg("/tmp")
.fails()
.code_is(1)
.stderr_only("du: invalid suffix in --block-size argument '1fb4t'");
#[cfg(not(target_pointer_width = "128"))]
new_ucmd!()
.arg("--block-size=1Y")
.arg("/tmp")
.fails()
.code_is(1)
.stderr_only("du: --block-size argument '1Y' too large");
}
#[test]
fn test_du_basics_bad_name() {
new_ucmd!()