mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
df: fix incorrect test & add another test
This commit is contained in:
parent
22588a8bfb
commit
8d3181fed5
1 changed files with 19 additions and 4 deletions
|
@ -179,13 +179,28 @@ fn test_default_headers() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_precedence_of_human_readable_header_over_output_header() {
|
fn test_precedence_of_human_readable_and_si_header_over_output_header() {
|
||||||
|
let args = ["-h", "--human-readable", "-H", "--si"];
|
||||||
|
|
||||||
|
for arg in args {
|
||||||
|
let output = new_ucmd!()
|
||||||
|
.args(&[arg, "--output=size"])
|
||||||
|
.succeeds()
|
||||||
|
.stdout_move_str();
|
||||||
|
let header = output.lines().next().unwrap();
|
||||||
|
assert_eq!(header, " Size");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_used_header_starts_with_space() {
|
||||||
let output = new_ucmd!()
|
let output = new_ucmd!()
|
||||||
.args(&["-H", "--output=size"])
|
// using -h here to ensure the width of the column's content is <= 4
|
||||||
|
.args(&["-h", "--output=used"])
|
||||||
.succeeds()
|
.succeeds()
|
||||||
.stdout_move_str();
|
.stdout_move_str();
|
||||||
let header = output.lines().next().unwrap().to_string();
|
let header = output.lines().next().unwrap();
|
||||||
assert_eq!(header.trim(), "Size");
|
assert_eq!(header, " Used");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue