Skip to content

Commit

Permalink
tests: update test_df.rs to use --output argument
Browse files Browse the repository at this point in the history
  • Loading branch information
jfinkels committed Feb 22, 2022
1 parent 1761c5d commit de0cb85
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions tests/by-util/test_df.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,14 @@ fn test_df_output() {
/// Test that the order of rows in the table does not change across executions.
#[test]
fn test_order_same() {
// TODO When #3057 is resolved, we should just use
//
// new_ucmd!().arg("--output=source").succeeds().stdout_move_str();
//
// instead of parsing the entire `df` table as a string.
let output1 = new_ucmd!().succeeds().stdout_move_str();
let output2 = new_ucmd!().succeeds().stdout_move_str();
let output1: Vec<String> = output1
.lines()
.map(|l| String::from(l.split_once(' ').unwrap().0))
.collect();
let output2: Vec<String> = output2
.lines()
.map(|l| String::from(l.split_once(' ').unwrap().0))
.collect();
let output1 = new_ucmd!()
.arg("--output=source")
.succeeds()
.stdout_move_str();
let output2 = new_ucmd!()
.arg("--output=source")
.succeeds()
.stdout_move_str();
assert_eq!(output1, output2);
}

Expand Down

0 comments on commit de0cb85

Please sign in to comment.