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