1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #7764 from BenWiederhake/dev-du-demo-working-features

du: test existing correct behavior: warn about --inodes -b conflict
This commit is contained in:
Daniel Hofstetter 2025-04-18 16:56:10 +02:00 committed by GitHub
commit 50a3940797
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1264,3 +1264,32 @@ fn test_du_blocksize_zero_do_not_panic() {
)); ));
} }
} }
#[test]
fn test_du_inodes_blocksize_ineffective() {
let ts = TestScenario::new(util_name!());
let at = &ts.fixtures;
let fpath = at.plus("test.txt");
at.touch(fpath);
for method in ["-B3", "--block-size=3"] {
// No warning
ts.ucmd()
.arg(method)
.arg("--inodes")
.arg("test.txt")
.succeeds()
.stdout_only("1\ttest.txt\n");
}
for method in ["--apparent-size", "-b"] {
// A warning appears!
ts.ucmd()
.arg(method)
.arg("--inodes")
.arg("test.txt")
.succeeds()
.stdout_is("1\ttest.txt\n")
.stderr_is(
"du: warning: options --apparent-size and -b are ineffective with --inodes\n",
);
}
}