test/system: Use 'command -v' to detect the presence of man(1)

'command -v' is more obvious when reading and is POSIX compatible [1].
While 'hash' also gets the job done, it's more of a caching mechanism.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html

https://github.com/containers/toolbox/pull/922
This commit is contained in:
Debarshi Ray 2021-11-12 21:39:59 +01:00
parent 3641a0032f
commit 01863d8fe0

View file

@ -9,7 +9,7 @@ setup() {
}
@test "help: Run command 'help'" {
if ! hash man 2>/dev/null; then
if ! command -v man 2>/dev/null; then
skip "Test works only if man is in PATH"
fi
@ -20,7 +20,7 @@ setup() {
}
@test "help: Run command 'help' with no man present" {
if hash man 2>/dev/null; then
if command -v man 2>/dev/null; then
skip "Test works only if man is not in PATH"
fi