aboutsummaryrefslogtreecommitdiffstats
path: root/tests/arith2.sub
diff options
context:
space:
mode:
Diffstat (limited to 'tests/arith2.sub')
-rw-r--r--tests/arith2.sub45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/arith2.sub b/tests/arith2.sub
new file mode 100644
index 0000000..7eac952
--- /dev/null
+++ b/tests/arith2.sub
@@ -0,0 +1,45 @@
+echo $(( --7 ))
+echo $(( ++7 ))
+echo $(( -- 7 ))
+echo $(( ++ 7 ))
+
+((++array[0] ))
+echo $array
+(( ++ array[0] ))
+echo $array
+
+(( ++a ))
+echo $a
+(( ++ a ))
+echo $a
+
+(( --a ))
+echo $a
+(( -- a ))
+echo $a
+
+echo $(( 4 + ++a ))
+echo $a
+
+echo $(( 4+++a ))
+echo $a
+
+echo $(( 4---a ))
+echo $a
+
+echo $(( 4 - -- a ))
+echo $a
+
+(( -- ))
+echo $(( ---7 ))
+echo $(( -- - 7 ))
+
+(( ++ ))
+echo $(( ++7 ))
+echo $(( ++ + 7 ))
+
+echo $(( ++-7 ))
+echo $(( ++ - 7 ))
+
+echo $(( +--7 ))
+echo $(( -- + 7 ))