Imported from ../bash-4.0-rc1.tar.gz.
[platform/upstream/bash.git] / tests / arith.tests
index fa56ad7..9e82bb1 100644 (file)
@@ -84,6 +84,12 @@ echo $(( 4<(2+3) ? 1 : 32))
 echo $(( (2+2)<(2+3) ? 1 : 32))
 echo $(( (2+2)>(2+3) ? 1 : 32))
 
+# bug in bash versions through bash-3.2
+S=105
+W=$((S>99?4:S>9?3:S>0?2:0))
+echo $W
+unset W S
+
 # check that the unevaluated part of the ternary operator does not do
 # evaluation or assignment
 x=i+=2
@@ -136,8 +142,8 @@ echo $(( 32#A ))
 echo $(( 56#A ))
 echo $(( 64#A ))
 
-echo $(( 64#_ ))
 echo $(( 64#@ ))
+echo $(( 64#_ ))
 
 # weird bases
 echo $(( 3425#56 ))
@@ -254,6 +260,9 @@ echo $(( -7 ))
 echo $(( ++7 ))
 echo $(( --7 ))
 
+${THIS_SH} ./arith1.sub
+${THIS_SH} ./arith2.sub
+
 x=4
 y=7
 
@@ -265,6 +274,7 @@ echo $x $y
 (( x=9 y=41 ))
 
 # These are errors
+unset b
 echo $((a b))
 ((a b))
 
@@ -275,3 +285,6 @@ echo $(( 8#$(printf "%o\n" $n) ))
 printf "%u\n" $n
 echo $(( 16#$(printf "%x\n" $n) ))
 echo $(( 16#$(printf "%X\n" $n) ))
+
+# causes longjmp botches through bash-2.05b
+a[b[c]d]=e