xref: /freebsd/bin/sh/tests/expansion/arith1.0 (revision b0d29bc47dba79f6f38e67eabadfb4b32ffd9390)
1# $FreeBSD$
2
3failures=0
4
5check() {
6	if [ $(($1)) != $2 ]; then
7		failures=$((failures+1))
8		echo "For $1, expected $2 actual $(($1))"
9	fi
10}
11
12check "0&&0" 0
13check "1&&0" 0
14check "0&&1" 0
15check "1&&1" 1
16check "2&&2" 1
17check "1&&2" 1
18check "1<<40&&1<<40" 1
19check "1<<40&&4" 1
20
21check "0||0" 0
22check "1||0" 1
23check "0||1" 1
24check "1||1" 1
25check "2||2" 1
26check "1||2" 1
27check "1<<40||1<<40" 1
28check "1<<40||4" 1
29
30exit $((failures != 0))
31