xref: /freebsd/bin/sh/tests/expansion/arith5.0 (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
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