1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

df: correct --total argument used in unit test

Add a missing dash to the `--total` argument applied in the
`test_df_output` test case. Before this commit, the argument `-total`
was treated as a path argument. After this commit, `--total` is
treated as a command-line option that causes the total file usage to
be displayed.
This commit is contained in:
Jeffrey Finkelstein 2022-04-09 12:40:52 -04:00 committed by jfinkels
parent ddf067f188
commit c5413167e2

View file

@ -28,16 +28,18 @@ fn test_df_compatible_si() {
#[test] #[test]
fn test_df_output() { fn test_df_output() {
// TODO These should fail because `-total` should have two dashes, let expected = if cfg!(target_os = "macos") {
// not just one. But they don't fail. "Filesystem Size Used Available Capacity Use% Mounted on "
if cfg!(target_os = "macos") {
new_ucmd!().arg("-H").arg("-total").succeeds().
stdout_only("Filesystem Size Used Available Capacity Use% Mounted on \n");
} else { } else {
new_ucmd!().arg("-H").arg("-total").succeeds().stdout_only( "Filesystem Size Used Available Use% Mounted on "
"Filesystem Size Used Available Use% Mounted on \n", };
); let output = new_ucmd!()
} .arg("-H")
.arg("--total")
.succeeds()
.stdout_move_str();
let actual = output.lines().take(1).collect::<Vec<&str>>()[0];
assert_eq!(actual, expected);
} }
/// Test that the order of rows in the table does not change across executions. /// Test that the order of rows in the table does not change across executions.