Skip to content

Commit

Permalink
df: fix rounding issue in test
Browse files Browse the repository at this point in the history
Set block size to 1 so the returned values are the same values as
used for the calculation of the percentage values
  • Loading branch information
cakebaker committed Nov 14, 2023
1 parent a3af223 commit 6861df1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/by-util/test_df.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,11 @@ fn test_total_label_in_correct_column() {
#[test]
fn test_use_percentage() {
let output = new_ucmd!()
.args(&["--total", "--output=used,avail,pcent"])
// set block size = 1, otherwise the returned values for
// "used" and "avail" will be rounded. And using them to calculate
// the "percentage" values might lead to a mismatch with the returned
// "percentage" values.
.args(&["--total", "--output=used,avail,pcent", "--block-size=1"])
.succeeds()
.stdout_move_str();

Expand Down

0 comments on commit 6861df1

Please sign in to comment.