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