Browse Source

nested array 5

main
pvincent 6 days ago
parent
commit
9ad6e2cc07
  1. 19
      test/associative.test.bash

19
test/associative.test.bash

@ -29,7 +29,12 @@ function nested_new {
declare -gn "$ref_name"="$nested_name"
local -n internal="$nested_name"
internal['TYPE']='NESTED_ARRAY'
# internal['VALUES']=("$@")
local i=0
local j=0
for j in "$@"; do
internal["$i"]="$j"
i=$((i + 1))
done
}
function nested_inspect {
@ -50,16 +55,6 @@ function nested_inspect {
array_new mine1 'Albert' 20
array_new mine2 'Bob' 24
array_new mine3 'Cobra' 31 true
# array_inspect mine1
# array_inspect mine2
# array_inspect mine3 " => "
declare -A nested
nested['TYPE']='NESTED_ARRAY'
nested[0]=mine1
nested[1]=mine2
nested[2]=mine3
nested_inspect nested
nested_new nested1 mine1 mine2 mine3
# nested_inspect nested1
nested_inspect nested1
Loading…
Cancel
Save