summaryrefslogtreecommitdiff
path: root/shell/hush_test
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-arith/arith.right17
-rwxr-xr-xshell/hush_test/hush-arith/arith.tests30
-rwxr-xr-xshell/hush_test/hush-arith/arith2.sub14
3 files changed, 37 insertions, 24 deletions
diff --git a/shell/hush_test/hush-arith/arith.right b/shell/hush_test/hush-arith/arith.right
index 2c389ca..a861229 100644
--- a/shell/hush_test/hush-arith/arith.right
+++ b/shell/hush_test/hush-arith/arith.right
@@ -70,6 +70,19 @@ octal, hex
263 263
255 255
40 40
+other bases
+10 10
+10 10
+10 10
+10 10
+10 10
+10 10
+36 36
+36 36
+62 62
+63 63
+missing number after base
+0 0
hush: arithmetic syntax error
hush: divide by zero
hush: can't execute 'let': No such file or directory
@@ -149,6 +162,10 @@ hush: arithmetic syntax error
-7
7
7
+-7 -7
+-7 -7
+7 7
+7 7
8 12
hush: arithmetic syntax error
42
diff --git a/shell/hush_test/hush-arith/arith.tests b/shell/hush_test/hush-arith/arith.tests
index a7aded1..6b70748 100755
--- a/shell/hush_test/hush-arith/arith.tests
+++ b/shell/hush_test/hush-arith/arith.tests
@@ -142,25 +142,25 @@ echo 255 $(( 0xff ))
echo 40 $(( 8 ^ 32 ))
-#ash# # other bases
-#ash# echo 10 $(( 16#a ))
-#ash# echo 10 $(( 32#a ))
-#ash# echo 10 $(( 56#a ))
-#ash# echo 10 $(( 64#a ))
-#ash#
-#ash# echo 10 $(( 16#A ))
-#ash# echo 10 $(( 32#A ))
-#ash# echo 36 $(( 56#A ))
-#ash# echo 36 $(( 64#A ))
-#ash#
-#ash# echo 62 $(( 64#@ ))
-#ash# echo 63 $(( 64#_ ))
+echo other bases
+echo 10 $(( 16#a ))
+echo 10 $(( 32#a ))
+echo 10 $(( 56#a ))
+echo 10 $(( 64#a ))
+
+echo 10 $(( 16#A ))
+echo 10 $(( 32#A ))
+echo 36 $(( 56#A ))
+echo 36 $(( 64#A ))
+
+echo 62 $(( 64#@ ))
+echo 63 $(( 64#_ ))
#ash# # weird bases (error)
#ash# echo $(( 3425#56 ))
-#ash# # missing number after base
-#ash# echo 0 $(( 2# ))
+echo missing number after base
+echo 0 $(( 2# ))
# these should generate errors
( echo $(( 7 = 43 )) )
diff --git a/shell/hush_test/hush-arith/arith2.sub b/shell/hush_test/hush-arith/arith2.sub
index 29f9471..8d79181 100755
--- a/shell/hush_test/hush-arith/arith2.sub
+++ b/shell/hush_test/hush-arith/arith2.sub
@@ -46,12 +46,8 @@ echo $(( ---7 ))
echo $(( ++7 ))
( echo $(( ++ + 7 )) )
-# bash 3.2: -7
-#ash# echo -7 $(( ++-7 ))
-# bash 3.2: -7
-#ash# echo -7 $(( ++ - 7 ))
-
-# bash 3.2: 7
-#ash# echo 7 $(( +--7 ))
-# bash 3.2: 7
-#ash# echo 7 $(( -- + 7 ))
+echo -7 $(( ++-7 ))
+echo -7 $(( ++ - 7 ))
+
+echo 7 $(( +--7 ))
+echo 7 $(( -- + 7 ))