diff options
Diffstat (limited to 'bin/sh/tests/builtins/command13.0')
-rw-r--r-- | bin/sh/tests/builtins/command13.0 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/sh/tests/builtins/command13.0 b/bin/sh/tests/builtins/command13.0 new file mode 100644 index 000000000000..7c011c938a47 --- /dev/null +++ b/bin/sh/tests/builtins/command13.0 @@ -0,0 +1,21 @@ +# $FreeBSD$ + +failures=0 + +check() { + if [ "$1" != "$2" ] && { [ "$#" -lt 3 ] || [ "$1" != "$3" ]; } then + echo "Mismatch found" + echo "Expected: $2" + if [ "$#" -ge 3 ]; then + echo "Alternative expected: $3" + fi + echo "Actual: $1" + : $((failures += 1)) + fi +} + +check "$(cd /bin && PATH=. command -v ls)" /bin/ls /bin/./ls +check "$(cd /bin && PATH=:/var/empty/nosuch command -v ls)" /bin/ls /bin/./ls +check "$(cd / && PATH=bin command -v ls)" /bin/ls +check "$(cd / && command -v bin/ls)" /bin/ls +check "$(cd /bin && command -v ./ls)" /bin/ls /bin/./ls |