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