summaryrefslogtreecommitdiffhomepage
path: root/shell/hush_test/hush-arith
diff options
context:
space:
mode:
Diffstat (limited to 'shell/hush_test/hush-arith')
-rw-r--r--shell/hush_test/hush-arith/arith.right20
-rwxr-xr-xshell/hush_test/hush-arith/arith.tests10
-rwxr-xr-xshell/hush_test/hush-arith/arith1.sub4
-rwxr-xr-xshell/hush_test/hush-arith/arith2.sub10
4 files changed, 25 insertions, 19 deletions
diff --git a/shell/hush_test/hush-arith/arith.right b/shell/hush_test/hush-arith/arith.right
index c48e468a5..2c389caea 100644
--- a/shell/hush_test/hush-arith/arith.right
+++ b/shell/hush_test/hush-arith/arith.right
@@ -106,6 +106,7 @@ hush: arithmetic syntax error
3 3
4 4
4 4
+7 7
hush: arithmetic syntax error
hush: arithmetic syntax error
hush: arithmetic syntax error
@@ -114,6 +115,8 @@ hush: arithmetic syntax error
4 4
7 7
-7 -7
+7
+7
hush: arithmetic syntax error
hush: arithmetic syntax error
hush: arithmetic syntax error
@@ -128,11 +131,12 @@ hush: arithmetic syntax error
2 2
-2 -2
1 1
-hush: arithmetic syntax error
-hush: arithmetic syntax error
-hush: arithmetic syntax error
-hush: arithmetic syntax error
-hush: arithmetic syntax error
+7
+7
+7
+7
+7
+7
5 5
1 1
6 6
@@ -141,8 +145,10 @@ hush: arithmetic syntax error
1 1
4 4
0 0
-hush: arithmetic syntax error
-hush: arithmetic syntax error
+-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 bc6b341d1..a7aded17d 100755
--- a/shell/hush_test/hush-arith/arith.tests
+++ b/shell/hush_test/hush-arith/arith.tests
@@ -255,8 +255,8 @@ echo 3 $x
echo 4 $(( ++x ))
echo 4 $x
-# bash 3.2 apparently thinks that ++7 is 7
-#ash# echo 7 $(( ++7 ))
+# ++ is not a inc operator on non-variable, it is the + + sequence
+echo 7 $(( ++7 ))
( echo $(( 7-- )) )
( echo $(( --x=7 )) )
@@ -270,9 +270,9 @@ echo 4 $x
echo 7 $(( +7 ))
echo -7 $(( -7 ))
-# bash 3.2 apparently thinks that ++7 is 7
-#ash# echo $(( ++7 ))
-#ash# echo $(( --7 ))
+# ++ is not a inc operator on non-variable, it is the + + sequence
+echo $(( ++7 ))
+echo $(( --7 ))
${THIS_SH} ./arith1.sub
${THIS_SH} ./arith2.sub
diff --git a/shell/hush_test/hush-arith/arith1.sub b/shell/hush_test/hush-arith/arith1.sub
index 80aa99922..a36785c67 100755
--- a/shell/hush_test/hush-arith/arith1.sub
+++ b/shell/hush_test/hush-arith/arith1.sub
@@ -35,6 +35,6 @@ echo 1 $a
#ash# (( ++ ))
( echo $(( +++7 )) )
-# bash 3.2 apparently thinks that ++ +7 is 7
-#ash# echo $(( ++ + 7 ))
+# ++ is not a inc operator on non-variable, it is the + + sequence
+echo $(( ++ + 7 ))
#ash# (( -- ))
diff --git a/shell/hush_test/hush-arith/arith2.sub b/shell/hush_test/hush-arith/arith2.sub
index 9105059db..29f9471d6 100755
--- a/shell/hush_test/hush-arith/arith2.sub
+++ b/shell/hush_test/hush-arith/arith2.sub
@@ -1,4 +1,4 @@
-# bash 3.2 apparently thinks that ++7 is 7 etc
+# ++ and -- are not inc/dec operators on non-variables, they are + + and - - sequences
( echo $(( --7 )) )
( echo $(( ++7 )) )
( echo $(( -- 7 )) )
@@ -37,13 +37,13 @@ echo 4 $(( 4 - -- a ))
echo 0 $a
#ash# (( -- ))
-# bash 3.2 apparently thinks that ---7 is -7
-#ash# echo $(( ---7 ))
+# -- is not a dec operator on non-variable, it is the - - sequence
+echo $(( ---7 ))
( echo $(( -- - 7 )) )
#ash# (( ++ ))
-# bash 3.2: 7
-#ash# echo 7 $(( ++7 ))
+# ++ is not a inc operator on non-variable, it is the + + sequence
+echo $(( ++7 ))
( echo $(( ++ + 7 )) )
# bash 3.2: -7