diff --git a/MANIFEST b/MANIFEST index e3817787..ce0fb931 100644 --- a/MANIFEST +++ b/MANIFEST @@ -772,6 +772,7 @@ tests/array7.sub f tests/array8.sub f tests/array9.sub f tests/array10.sub f +tests/array11.sub f tests/array-at-star f tests/array2.right f tests/assoc.tests f diff --git a/tests/RUN-ONE-TEST b/tests/RUN-ONE-TEST index 72ec06a2..3efcf32d 100755 --- a/tests/RUN-ONE-TEST +++ b/tests/RUN-ONE-TEST @@ -1,4 +1,4 @@ -BUILD_DIR=/usr/local/build/bash/bash-current +BUILD_DIR=/usr/local/build/chet/bash/bash-current THIS_SH=$BUILD_DIR/bash PATH=$PATH:$BUILD_DIR diff --git a/tests/array.right b/tests/array.right index 94c64a74..9df235fc 100644 --- a/tests/array.right +++ b/tests/array.right @@ -341,3 +341,11 @@ ednesday onday uesday ednesday +version[agent] +version.agent +version[agent] +version.agent +version[agent] foo[bar] +version.agent bowl +foobar] foo foo[bar] +bleh bbb bleh diff --git a/tests/array.tests b/tests/array.tests index 3b6996d3..88d12e3a 100644 --- a/tests/array.tests +++ b/tests/array.tests @@ -388,3 +388,5 @@ ${THIS_SH} ./array8.sub ${THIS_SH} ./array9.sub ${THIS_SH} ./array10.sub + +${THIS_SH} ./array11.sub diff --git a/tests/array11.sub b/tests/array11.sub new file mode 100644 index 00000000..87cf0115 --- /dev/null +++ b/tests/array11.sub @@ -0,0 +1,29 @@ +# problems with associative array keys with ] and unbalanced [ ] +# fixed after bash-4.2 + +declare -A foo + +foo=(["version[agent]"]=version.agent) + +echo ${!foo[@]} +echo ${foo[@]} + +unset foo +declare -A foo +foo["version[agent]"]=version.agent + +echo ${!foo[@]} +echo ${foo[@]} + +declare foo["foo[bar]"]=bowl + +echo ${!foo[@]} +echo ${foo[@]} + +declare -A array2["foo[bar]"]=bleh + +array2["foobar]"]=bleh +array2["foo"]=bbb + +echo ${!array2[@]} +echo ${array2[@]}