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-postinc.right5
-rwxr-xr-xshell/hush_test/hush-arith/arith-postinc.tests5
-rw-r--r--shell/hush_test/hush-arith/arith.right4
-rwxr-xr-xshell/hush_test/hush-arith/arith2.sub12
4 files changed, 20 insertions, 6 deletions
diff --git a/shell/hush_test/hush-arith/arith-postinc.right b/shell/hush_test/hush-arith/arith-postinc.right
new file mode 100644
index 000000000..c95ce02bf
--- /dev/null
+++ b/shell/hush_test/hush-arith/arith-postinc.right
@@ -0,0 +1,5 @@
+1 1
+1 1
+1 1
+1 1
+Ok:0
diff --git a/shell/hush_test/hush-arith/arith-postinc.tests b/shell/hush_test/hush-arith/arith-postinc.tests
new file mode 100755
index 000000000..3fd9bfed5
--- /dev/null
+++ b/shell/hush_test/hush-arith/arith-postinc.tests
@@ -0,0 +1,5 @@
+echo 1 $((0++1))
+echo 1 $((0--1))
+x=-1; echo 1 $((0-$x))
+x=+1; echo 1 $((0+$x))
+echo Ok:$?
diff --git a/shell/hush_test/hush-arith/arith.right b/shell/hush_test/hush-arith/arith.right
index 8a201fb3b..c48e468a5 100644
--- a/shell/hush_test/hush-arith/arith.right
+++ b/shell/hush_test/hush-arith/arith.right
@@ -135,6 +135,10 @@ hush: arithmetic syntax error
hush: arithmetic syntax error
5 5
1 1
+6 6
+2 2
+3 3
+1 1
4 4
0 0
hush: arithmetic syntax error
diff --git a/shell/hush_test/hush-arith/arith2.sub b/shell/hush_test/hush-arith/arith2.sub
index f7e3c9235..9105059db 100755
--- a/shell/hush_test/hush-arith/arith2.sub
+++ b/shell/hush_test/hush-arith/arith2.sub
@@ -23,14 +23,14 @@
echo 5 $(( 4 + ++a ))
echo 1 $a
-# ash doesn't handle it right...
-#ash# echo 6 $(( 4+++a ))
-#ash# echo 2 $a
+# this is treated as 4 + ++a
+echo 6 $(( 4+++a ))
+echo 2 $a
a=2
-# ash doesn't handle it right...
-#ash# echo 3 $(( 4---a ))
-#ash# echo 1 $a
+# this is treated as 4 - --a
+echo 3 $(( 4---a ))
+echo 1 $a
a=1
echo 4 $(( 4 - -- a ))