From 331003c60e47a54601e6e6bd2fbd3b10f993a5d0 Mon Sep 17 00:00:00 2001 From: fortifiedhill <24689525+fortifiedhill@users.noreply.github.com> Date: Sat, 23 Mar 2024 03:36:37 -0500 Subject: [PATCH] w: Add test for --no-header --- tests/by-util/test_w.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/by-util/test_w.rs b/tests/by-util/test_w.rs index c3afeaf6..9203273c 100644 --- a/tests/by-util/test_w.rs +++ b/tests/by-util/test_w.rs @@ -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")); +}