mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
du: fix the size display with --inodes
This commit is contained in:
parent
76d14ed484
commit
1b2778b819
2 changed files with 30 additions and 4 deletions
|
@ -1198,3 +1198,25 @@ fn test_invalid_time_style() {
|
|||
.succeeds()
|
||||
.stdout_does_not_contain("du: invalid argument 'banana' for 'time style'");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_human_size() {
|
||||
use std::fs::File;
|
||||
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = &ts.fixtures;
|
||||
let dir = at.plus_as_string("d");
|
||||
at.mkdir(&dir);
|
||||
|
||||
for i in 1..=1023 {
|
||||
let file_path = format!("{dir}/file{i}");
|
||||
File::create(&file_path).expect("Failed to create file");
|
||||
}
|
||||
|
||||
ts.ucmd()
|
||||
.arg("--inodes")
|
||||
.arg("-h")
|
||||
.arg(&dir)
|
||||
.succeeds()
|
||||
.stdout_contains(format!("1.0K {dir}"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue