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

df: test default blocksize in POSIX mode

This commit is contained in:
Daniel Hofstetter 2022-05-12 10:11:24 +02:00
parent 6f5d5aa456
commit 598dc79b69

View file

@ -435,6 +435,30 @@ fn test_default_block_size() {
assert_eq!(header, "512B-blocks");
}
#[test]
fn test_default_block_size_in_posix_portability_mode() {
fn get_header(s: &str) -> String {
s.lines()
.next()
.unwrap()
.to_string()
.split_whitespace()
.nth(1)
.unwrap()
.to_string()
}
let output = new_ucmd!().arg("-P").succeeds().stdout_move_str();
assert_eq!(get_header(&output), "1024-blocks");
let output = new_ucmd!()
.arg("-P")
.env("POSIXLY_CORRECT", "1")
.succeeds()
.stdout_move_str();
assert_eq!(get_header(&output), "512-blocks");
}
#[test]
fn test_block_size_1024() {
fn get_header(block_size: u64) -> String {