summaryrefslogtreecommitdiffstats
path: root/tests/array12.sub
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/array12.sub21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/array12.sub b/tests/array12.sub
new file mode 100644
index 0000000..6571138
--- /dev/null
+++ b/tests/array12.sub
@@ -0,0 +1,21 @@
+# problems with fix for posix interp 217 introduced in bash-4.2
+
+declare -ax array
+array[$(( $( echo -n 1001 ) - 1001 ))]=1
+
+echo ${array[0]}
+echo ${array[@]}
+
+unset 'array[0]'
+array[$( echo -n 1001 ) - 1001 ]=1
+echo ${array[0]}
+
+unset 'array[0]'
+array[$(( 1001 - $( echo -n 1001 ) ))]=1
+echo ${array[0]}
+array[$(( 1001 - $( echo -n 1001 ) ))]=1
+echo ${array[0]}
+
+unset 'array[0]'
+array[1001 - $( echo -n 1001 )]=1
+echo ${array[0]}