Add regression tests for /bin/sh.
[dragonfly.git] / tools / regression / bin / sh / expansion / arith1.0
1 # $FreeBSD: src/tools/regression/bin/sh/expansion/arith1.0,v 1.1 2009/12/30 15:59:40 jilles Exp $
2
3 failures=0
4
5 check() {
6         if [ $(($1)) != $2 ]; then
7                 failures=$((failures+1))
8                 echo "For $1, expected $2 actual $(($1))"
9         fi
10 }
11
12 check "0&&0" 0
13 check "1&&0" 0
14 check "0&&1" 0
15 check "1&&1" 1
16 check "2&&2" 1
17 check "1&&2" 1
18 check "1<<40&&1<<40" 1
19 check "1<<40&&4" 1
20
21 check "0||0" 0
22 check "1||0" 1
23 check "0||1" 1
24 check "1||1" 1
25 check "2||2" 1
26 check "1||2" 1
27 check "1<<40||1<<40" 1
28 check "1<<40||4" 1
29
30 exit $((failures != 0))