Merge pull request #3428 from cakebaker/fix_test_df_output_overridden

df: fix broken "test_df_output_overridden" test
This commit is contained in:
Sylvestre Ledru 2022-04-19 08:06:39 +02:00 committed by GitHub
commit 346902e30b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,9 +101,26 @@ fn test_df_output() {
#[test]
fn test_df_output_overridden() {
let expected = if cfg!(target_os = "macos") {
"Filesystem Size Used Available Capacity Use% Mounted on "
vec![
"Filesystem",
"Size",
"Used",
"Available",
"Capacity",
"Use%",
"Mounted",
"on",
]
} else {
"Filesystem Size Used Available Use% Mounted on "
vec![
"Filesystem",
"Size",
"Used",
"Available",
"Use%",
"Mounted",
"on",
]
};
let output = new_ucmd!()
.arg("-hH")
@ -111,6 +128,7 @@ fn test_df_output_overridden() {
.succeeds()
.stdout_move_str();
let actual = output.lines().take(1).collect::<Vec<&str>>()[0];
let actual = actual.split_whitespace().collect::<Vec<_>>();
assert_eq!(actual, expected);
}