mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
df: test default blocksize in POSIX mode
This commit is contained in:
parent
6f5d5aa456
commit
598dc79b69
1 changed files with 24 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue