Skip to content

Commit

Permalink
w: Add test for --no-header
Browse files Browse the repository at this point in the history
  • Loading branch information
fortifiedhill authored and sylvestre committed Mar 24, 2024
1 parent ce92dcf commit 331003c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/by-util/test_w.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@ use crate::common::util::TestScenario;
fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
}

#[test]
fn test_no_header() {
let cmd = new_ucmd!().arg("--no-header").succeeds();

let result = cmd.stdout_str();

assert!(!result.contains("USER\tTTY\t\tLOGIN@\t\tIDLE\tJCPU\tPCPU\tWHAT"));
}

0 comments on commit 331003c

Please sign in to comment.