summaryrefslogtreecommitdiffhomepage
path: root/shell/hush_test
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2021-09-26 13:25:49 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2021-09-26 13:29:25 +0200
commit1be73dd9ad6d2cf6747934374c1d58bd9bc211b4 (patch)
treea009dd15c30f36a991f945cca931c437479cd200 /shell/hush_test
parent62e433131b289ea90e465cf0c5f78c8c226fc692 (diff)
shell: fix parsing of $(( (v)++ + NUM ))
function old new delta evaluate_string 988 1011 +23 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush_test')
-rw-r--r--shell/hush_test/hush-arith/arith-postinc.right3
-rwxr-xr-xshell/hush_test/hush-arith/arith-postinc.tests4
2 files changed, 7 insertions, 0 deletions
diff --git a/shell/hush_test/hush-arith/arith-postinc.right b/shell/hush_test/hush-arith/arith-postinc.right
index c95ce02bf..5cd4ba6b4 100644
--- a/shell/hush_test/hush-arith/arith-postinc.right
+++ b/shell/hush_test/hush-arith/arith-postinc.right
@@ -2,4 +2,7 @@
1 1
1 1
1 1
+6 6
+7 7
+7 7
Ok:0
diff --git a/shell/hush_test/hush-arith/arith-postinc.tests b/shell/hush_test/hush-arith/arith-postinc.tests
index 3fd9bfed5..f2ae778df 100755
--- a/shell/hush_test/hush-arith/arith-postinc.tests
+++ b/shell/hush_test/hush-arith/arith-postinc.tests
@@ -2,4 +2,8 @@ echo 1 $((0++1))
echo 1 $((0--1))
x=-1; echo 1 $((0-$x))
x=+1; echo 1 $((0+$x))
+a=3
+echo 6 $((a+++3)) # a++ + 3
+echo 7 $(((a)+++3)) # a + + + 3
+echo 7 $(((a)+++3)) # a + + + 3
echo Ok:$?