]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - tools/regression/bin/sh/expansion/arith5.0
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / tools / regression / bin / sh / expansion / arith5.0
1 # $FreeBSD$
2
3 failures=0
4
5 check() {
6         if [ "$2" != "$3" ]; then
7                 failures=$((failures+1))
8                 echo "For $1, expected $3 actual $2"
9         fi
10 }
11
12 unset a
13 check '$((1+${a:-$((7+2))}))' "$((1+${a:-$((7+2))}))" 10
14 check '$((1+${a:=$((2+2))}))' "$((1+${a:=$((2+2))}))" 5
15 check '$a' "$a" 4
16
17 exit $((failures != 0))