X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fbash.git;a=blobdiff_plain;f=tests%2Farray.tests;h=d8b6564fe8c533400c156d25b8dc30419a725487;hp=6f23486d084d2694bf43e8d740b98f60b0239f5b;hb=28ef6c316f1aff914bb95ac09787a3c83c1815fd;hpb=bb70624e964126b7ac4ff085ba163a9c35ffa18f diff --git a/tests/array.tests b/tests/array.tests index 6f23486d0..d8b6564fe 100644 --- a/tests/array.tests +++ b/tests/array.tests @@ -253,6 +253,11 @@ echo ${foo[@]} foo=( 4414758999202 ) echo ${foo[@]} +# this was a bug in all versions of bash 2.x up to and including bash-2.04 +declare -a ddd=(aaa +bbb) +echo ${ddd[@]} + # errors foo=(a b c for case if then else) @@ -260,3 +265,16 @@ foo=(for case if then else) metas=( <> < > ! ) metas=( [1]=<> [2]=< [3]=> [4]=! ) + +# various expansions that didn't really work right until post-bash-2.04 +foo='abc' +echo ${foo[0]} ${#foo[0]} +echo ${foo[1]} ${#foo[1]} +echo ${foo[@]} ${#foo[@]} +echo ${foo[*]} ${#foo[*]} + +foo='' +echo ${foo[0]} ${#foo[0]} +echo ${foo[1]} ${#foo[1]} +echo ${foo[@]} ${#foo[@]} +echo ${foo[*]} ${#foo[*]}