mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
tests: update test_df.rs to use --output argument
This commit is contained in:
parent
ec048b3857
commit
c0cd017706
1 changed files with 8 additions and 15 deletions
|
@ -43,21 +43,14 @@ fn test_df_output() {
|
||||||
/// 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.
|
||||||
#[test]
|
#[test]
|
||||||
fn test_order_same() {
|
fn test_order_same() {
|
||||||
// TODO When #3057 is resolved, we should just use
|
let output1 = new_ucmd!()
|
||||||
//
|
.arg("--output=source")
|
||||||
// new_ucmd!().arg("--output=source").succeeds().stdout_move_str();
|
.succeeds()
|
||||||
//
|
.stdout_move_str();
|
||||||
// instead of parsing the entire `df` table as a string.
|
let output2 = new_ucmd!()
|
||||||
let output1 = new_ucmd!().succeeds().stdout_move_str();
|
.arg("--output=source")
|
||||||
let output2 = new_ucmd!().succeeds().stdout_move_str();
|
.succeeds()
|
||||||
let output1: Vec<String> = output1
|
.stdout_move_str();
|
||||||
.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();
|
|
||||||
assert_eq!(output1, output2);
|
assert_eq!(output1, output2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue