]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - bin/sh/tests/expansion/arith9.0
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / bin / sh / tests / expansion / arith9.0
1 # $FreeBSD$
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 ? 44 : 51" 51
13 check "1 ? 68 : 30" 68
14 check "2 ? 1 : -5" 1
15 check "0 ? 4 : 0 ? 5 : 6" 6
16 check "0 ? 4 : 1 ? 5 : 6" 5
17 check "1 ? 4 : 0 ? 5 : 6" 4
18 check "1 ? 4 : 1 ? 5 : 6" 4
19
20 exit $((failures != 0))