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

df: show "block-size argument too large" error

This commit is contained in:
Daniel Hofstetter 2022-04-30 15:36:50 +02:00
parent 69f8543d8f
commit 15412f100a
2 changed files with 39 additions and 6 deletions

View file

@ -419,6 +419,30 @@ fn test_block_size_with_suffix() {
//assert_eq!(get_header("1GB"), "1GB-blocks");
}
#[test]
fn test_too_large_block_size() {
fn run_command(size: &str) {
new_ucmd!()
.arg(format!("--block-size={}", size))
.fails()
.stderr_contains(format!("--block-size argument '{}' too large", size));
}
let too_large_sizes = vec!["1Y", "1Z"];
for size in too_large_sizes {
run_command(size);
}
}
#[test]
fn test_invalid_block_size() {
new_ucmd!()
.arg("--block-size=x")
.fails()
.stderr_contains("invalid --block-size argument 'x'");
}
#[test]
fn test_output_selects_columns() {
let output = new_ucmd!()