From b08293e544fb5eb5e004f02139e4aa06660395b6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 22:34:44 +0200 Subject: Adding debian version 2:4.0.4-4. Signed-off-by: Daniel Baumann --- debian/tests/w | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 debian/tests/w (limited to 'debian/tests/w') diff --git a/debian/tests/w b/debian/tests/w new file mode 100644 index 0000000..6a4c15f --- /dev/null +++ b/debian/tests/w @@ -0,0 +1,37 @@ +#!/bin/sh + +exec 2>&1 + +test_no_arguments() { + ( w >"${stdoutF}" 2>"${stderrF}" ) + rtrn=$? + + assertEquals "w exit value" "0" "${rtrn}" + grep -E '^USER[[:space:]]+TTY[[:space:]]+FROM' "${stdoutF}" > /dev/null + assertTrue 'header line' $? +} + +test_no_header() { + ( w -h >"${stdoutF}" 2>"${stderrF}" ) + rtrn=$? + + assertEquals "w exit value" "0" "${rtrn}" + grep -E '^USER[[:space:]]+TTY[[:space:]]+FROM' "${stdoutF}" > /dev/null + assertFalse 'header line with -h option' $? +} +oneTimeSetUp() { + # Define global variables for command output. + stdoutF="${AUTOPKGTEST_TMP}/stdout" + stderrF="${AUTOPKGTEST_TMP}/stderr" +} + +setUp() { + # Truncate the output files. + cp /dev/null "${stdoutF}" + cp /dev/null "${stderrF}" +} + + +# shellcheck disable=SC1091 +. shunit2 + -- cgit v1.2.3