From e04d6b7bf58a95105a8fc79fcde7c0e98875e72a Mon Sep 17 00:00:00 2001 From: a1346054 <36859588+a1346054@users.noreply.github.com> Date: Tue, 13 Sep 2022 18:42:15 +0000 Subject: tests: directly test for presence of command Test directly for presence of command instead of indirectly testing the return code. Additionally: * uses a shell builtin `command -v` instead of external `which` * `command -v` is the standardized version of `which` --- test/private-lib/private-lib.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/private-lib/private-lib.sh') diff --git a/test/private-lib/private-lib.sh b/test/private-lib/private-lib.sh index d168c2b1b..86ed7b06d 100755 --- a/test/private-lib/private-lib.sh +++ b/test/private-lib/private-lib.sh @@ -11,8 +11,7 @@ LIST="gnome-logs gnome-system-log gnome-nettool pavucontrol dig evince whois gal for app in $LIST; do - which $app 2>/dev/null - if [ "$?" -eq 0 ]; + if command -v "$app" then echo "TESTING: private-lib $app" ./$app.exp -- cgit v1.2.3-54-g00ecf