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