diff options
author | 2022-09-13 18:42:15 +0000 | |
---|---|---|
committer | 2022-09-13 22:37:18 +0000 | |
commit | e04d6b7bf58a95105a8fc79fcde7c0e98875e72a (patch) | |
tree | 6e20913ed5d4af3e1b0ef5a31ef80ee42f651376 /test/utils/utils.sh | |
parent | tests: fix unintentional overwriting of array value (diff) | |
download | firejail-e04d6b7bf58a95105a8fc79fcde7c0e98875e72a.tar.gz firejail-e04d6b7bf58a95105a8fc79fcde7c0e98875e72a.tar.zst firejail-e04d6b7bf58a95105a8fc79fcde7c0e98875e72a.zip |
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`
Diffstat (limited to 'test/utils/utils.sh')
-rwxr-xr-x | test/utils/utils.sh | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 102c8df17..ad36d7053 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh | |||
@@ -33,8 +33,7 @@ echo "TESTING: version (test/utils/version.exp)" | |||
33 | echo "TESTING: help (test/utils/help.exp)" | 33 | echo "TESTING: help (test/utils/help.exp)" |
34 | ./help.exp | 34 | ./help.exp |
35 | 35 | ||
36 | which man 2>/dev/null | 36 | if command -v man |
37 | if [ "$?" -eq 0 ]; | ||
38 | then | 37 | then |
39 | echo "TESTING: man (test/utils/man.exp)" | 38 | echo "TESTING: man (test/utils/man.exp)" |
40 | ./man.exp | 39 | ./man.exp |