]> git.saurik.com Git - apple/shell_cmds.git/blame - sh/tests/expansion/arith9.0
shell_cmds-207.11.1.tar.gz
[apple/shell_cmds.git] / sh / tests / expansion / arith9.0
CommitLineData
deb63bfb 1# $FreeBSD: head/bin/sh/tests/expansion/arith9.0 218469 2011-02-08 23:23:55Z jilles $
71aad674
A
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 ? 44 : 51" 51
13check "1 ? 68 : 30" 68
14check "2 ? 1 : -5" 1
15check "0 ? 4 : 0 ? 5 : 6" 6
16check "0 ? 4 : 1 ? 5 : 6" 5
17check "1 ? 4 : 0 ? 5 : 6" 4
18check "1 ? 4 : 1 ? 5 : 6" 4
19
20exit $((failures != 0))