arith5.0 revision 206168
1206168Sjilles# $FreeBSD: head/tools/regression/bin/sh/expansion/arith5.0 206168 2010-04-04 16:48:33Z jilles $ 2206168Sjilles 3206168Sjillesfailures=0 4206168Sjilles 5206168Sjillescheck() { 6206168Sjilles if [ "$2" != "$3" ]; then 7206168Sjilles failures=$((failures+1)) 8206168Sjilles echo "For $1, expected $3 actual $2" 9206168Sjilles fi 10206168Sjilles} 11206168Sjilles 12206168Sjillesunset a 13206168Sjillescheck '$((1+${a:-$((7+2))}))' "$((1+${a:-$((7+2))}))" 10 14206168Sjillescheck '$((1+${a:=$((2+2))}))' "$((1+${a:=$((2+2))}))" 5 15206168Sjillescheck '$a' "$a" 4 16206168Sjilles 17206168Sjillesexit $((failures != 0)) 18