]> git.saurik.com Git - apple/shell_cmds.git/blame - sh/tests/builtins/command7.0
shell_cmds-216.60.1.tar.gz
[apple/shell_cmds.git] / sh / tests / builtins / command7.0
CommitLineData
deb63bfb 1# $FreeBSD: head/bin/sh/tests/builtins/command7.0 218356 2011-02-05 23:00:24Z jilles $
71aad674
A
2
3failures=0
4
5check() {
6 if ! eval "[ $* ]"; then
7 echo "Failed: $*"
8 : $((failures += 1))
9 fi
10}
11
12check '"$(PATH=/libexec command -V ld-elf.so.1)" = "ld-elf.so.1 is /libexec/ld-elf.so.1"'
13check '"$(PATH=/libexec command -V ld-elf.so.1; :)" = "ld-elf.so.1 is /libexec/ld-elf.so.1"'
14check '"$(PATH=/libexec command -pv ld-elf.so.1)" = ""'
15check '"$(PATH=/libexec command -pv ld-elf.so.1; :)" = ""'
16
17PATH=/libexec:$PATH
18
19check '"$(command -V ld-elf.so.1)" = "ld-elf.so.1 is /libexec/ld-elf.so.1"'
20check '"$(command -V ld-elf.so.1; :)" = "ld-elf.so.1 is /libexec/ld-elf.so.1"'
21check '"$(command -pv ld-elf.so.1)" = ""'
22check '"$(command -pv ld-elf.so.1; :)" = ""'
23
24PATH=/libexec
25
26check '"$(command -v ls)" = ""'
27case $(command -pv ls) in
28/*/ls) ;;
29*)
30 echo "Failed: \$(command -pv ls) match /*/ls"
31 : $((failures += 1)) ;;
32esac
33
34exit $((failures > 0))