mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #3522 from cakebaker/add_missing_default_blocksize_test
df: test default blocksize in POSIX mode
This commit is contained in:
commit
8891571e9a
1 changed files with 24 additions and 0 deletions
|
@ -435,6 +435,30 @@ fn test_default_block_size() {
|
||||||
assert_eq!(header, "512B-blocks");
|
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]
|
#[test]
|
||||||
fn test_block_size_1024() {
|
fn test_block_size_1024() {
|
||||||
fn get_header(block_size: u64) -> String {
|
fn get_header(block_size: u64) -> String {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue