arith1.0 revision 201259
1201259Sjilles# $FreeBSD: head/tools/regression/bin/sh/expansion/arith1.0 201259 2009-12-30 15:59:40Z jilles $ 2201259Sjilles 3201259Sjillesfailures=0 4201259Sjilles 5201259Sjillescheck() { 6201259Sjilles if [ $(($1)) != $2 ]; then 7201259Sjilles failures=$((failures+1)) 8201259Sjilles echo "For $1, expected $2 actual $(($1))" 9201259Sjilles fi 10201259Sjilles} 11201259Sjilles 12201259Sjillescheck "0&&0" 0 13201259Sjillescheck "1&&0" 0 14201259Sjillescheck "0&&1" 0 15201259Sjillescheck "1&&1" 1 16201259Sjillescheck "2&&2" 1 17201259Sjillescheck "1&&2" 1 18201259Sjillescheck "1<<40&&1<<40" 1 19201259Sjillescheck "1<<40&&4" 1 20201259Sjilles 21201259Sjillescheck "0||0" 0 22201259Sjillescheck "1||0" 1 23201259Sjillescheck "0||1" 1 24201259Sjillescheck "1||1" 1 25201259Sjillescheck "2||2" 1 26201259Sjillescheck "1||2" 1 27201259Sjillescheck "1<<40||1<<40" 1 28201259Sjillescheck "1<<40||4" 1 29201259Sjilles 30201259Sjillesexit $((failures != 0)) 31