From 01863d8fe0f884a8826154c2fd6281f1d0919e51 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Fri, 12 Nov 2021 21:39:59 +0100 Subject: [PATCH] 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 --- test/system/002-help.bats | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/system/002-help.bats b/test/system/002-help.bats index 7483bd1..48d69cd 100644 --- a/test/system/002-help.bats +++ b/test/system/002-help.bats @@ -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