1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-16 03:36:18 +00:00

Merge pull request #3482 from cakebaker/handle_posixly_correct

df: use blocksize of 512 if POSIXLY_CORRECT is set
This commit is contained in:
jfinkels 2022-05-09 19:43:58 -04:00 committed by GitHub
commit ae580cd54a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 {