]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - bin/sh/tests/builtins/command7.0
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / bin / sh / tests / builtins / command7.0
1 # $FreeBSD$
2
3 failures=0
4
5 check() {
6         if ! eval "[ $* ]"; then
7                 echo "Failed: $*"
8                 : $((failures += 1))
9         fi
10 }
11
12 check '"$(PATH=/libexec command -V ld-elf.so.1)" = "ld-elf.so.1 is /libexec/ld-elf.so.1"'
13 check '"$(PATH=/libexec command -V ld-elf.so.1; :)" = "ld-elf.so.1 is /libexec/ld-elf.so.1"'
14 check '"$(PATH=/libexec command -pv ld-elf.so.1)" = ""'
15 check '"$(PATH=/libexec command -pv ld-elf.so.1; :)" = ""'
16
17 PATH=/libexec:$PATH
18
19 check '"$(command -V ld-elf.so.1)" = "ld-elf.so.1 is /libexec/ld-elf.so.1"'
20 check '"$(command -V ld-elf.so.1; :)" = "ld-elf.so.1 is /libexec/ld-elf.so.1"'
21 check '"$(command -pv ld-elf.so.1)" = ""'
22 check '"$(command -pv ld-elf.so.1; :)" = ""'
23
24 PATH=/libexec
25
26 check '"$(command -v ls)" = ""'
27 case $(command -pv ls) in
28 /*/ls) ;;
29 *)
30         echo "Failed: \$(command -pv ls) match /*/ls"
31         : $((failures += 1)) ;;
32 esac
33
34 exit $((failures > 0))