Skip to content

Commit 21205ae

Browse files
jayhemnani9910sylvestre
authored andcommitted
ps: check the value under PID in the column test
1 parent 3aded06 commit 21205ae

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎tests/by-util/test_ps.rs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,9 @@ fn test_unimplemented_field_keeps_columns_aligned() {
433433
.succeeds()
434434
.stdout_move_str();
435435
let mut lines = out.lines();
436-
let headers = lines.next().unwrap().split_whitespace().count();
437-
let values = lines.next().unwrap().split_whitespace().count();
438-
assert_eq!(headers, values);
436+
let headers: Vec<_> = lines.next().unwrap().split_whitespace().collect();
437+
let values: Vec<_> = lines.next().unwrap().split_whitespace().collect();
438+
assert_eq!(headers.len(), values.len());
439+
let pid = headers.iter().position(|h| *h == "PID").unwrap();
440+
assert_eq!(values[pid], "1");
439441
}

0 commit comments

Comments
 (0)