]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/bin/sh/expansion/cmdsubst7.0
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / bin / sh / expansion / cmdsubst7.0
1 # $FreeBSD$
2
3 failures=''
4 ok=''
5
6 testcase() {
7         code="$1"
8
9         unset v
10         eval ": \$($code)"
11
12         if [ "${v:+bad}" = "" ]; then
13                 ok=x$ok
14         else
15                 failures=x$failures
16                 echo "Failure for $code"
17         fi
18 }
19
20 testcase ': ${v=0}'
21 testcase ': ${v:=0}'
22 testcase ': $((v=1))'
23 testcase ': $((v+=1))'
24 w='v=1'
25 testcase ': $(($w))'
26 testcase ': $((${$+v=1}))'
27 testcase ': $((v${$+=1}))'
28 testcase ': $((v $(echo =) 1))'
29 testcase ': $(($(echo $w)))'
30
31 test "x$failures" = x