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

df: use blocksize of 512 if POSIXLY_CORRECT is set

This commit is contained in:
Daniel Hofstetter 2022-05-05 10:53:40 +02:00
parent e5d973718c
commit f668b69a2c
3 changed files with 45 additions and 2 deletions

View file

@ -375,6 +375,26 @@ fn test_iuse_percentage() {
}
}
#[test]
fn test_default_block_size() {
let output = new_ucmd!()
.arg("--output=size")
.succeeds()
.stdout_move_str();
let header = output.lines().next().unwrap().to_string();
assert_eq!(header, "1K-blocks");
let output = new_ucmd!()
.arg("--output=size")
.env("POSIXLY_CORRECT", "1")
.succeeds()
.stdout_move_str();
let header = output.lines().next().unwrap().to_string();
assert_eq!(header, "512B-blocks");
}
#[test]
fn test_block_size_1024() {
fn get_header(block_size: u64) -> String {