xref: /freebsd/bin/sh/tests/expansion/arith5.0 (revision e9ac41698b2f322d55ccf9da50a3596edb2c1800)
1
2failures=0
3
4check() {
5	if [ "$2" != "$3" ]; then
6		failures=$((failures+1))
7		echo "For $1, expected $3 actual $2"
8	fi
9}
10
11unset a
12check '$((1+${a:-$((7+2))}))' "$((1+${a:-$((7+2))}))" 10
13check '$((1+${a:=$((2+2))}))' "$((1+${a:=$((2+2))}))" 5
14check '$a' "$a" 4
15
16exit $((failures != 0))
17