Lines Matching defs:foo
38 nameref foo=p
39 if [[ ${foo.x} != ${Point.x} ]]
42 unset foo
64 x=( [foo]=bar )
68 unset -n foo x
69 unset foo x
70 foo=( x=3)
71 nameref x=foo
72 if [[ ${!x.@} != foo.x ]]
79 x.foo.bar=7
80 [[ ${x.foo.bar} == 7 ]] || err_exit '[[ ${x.foo.bar} != 7 ]]'
81 (( x.foo.bar == 7 ))|| err_exit '(( x.foo.bar != 7 ))'
82 [[ ${x.foo} == *bar=7* ]] || err_exit '[[ ${x.foo} != *bar=7* ]]'
84 foo=(integer x=3)
85 if [[ ${foo} != *x=3* ]]
88 $SHELL -c $'x=(foo=bar)\n[[ x == x ]]' 2> /dev/null ||
90 unset foo
91 [[ ${!foo.@} ]] && err_exit 'unset compound variable leaves subvariables'
184 foo=( bar=foo barbar=bar)
185 [[ $foo == *bar=foo* ]] || err_exit 'no prefix elements in compound variable output'
194 [[ $($SHELL -c 'foo=();foo.[x]=(y z); print ${foo.x[@]}') == 'y z' ]] 2> /dev/null || err_exit 'foo=( [x]=(y z) not working'
213 ( [[ ${z.foo.bar:-abc} == abc ]] 2> /dev/null) || err_exit ':- not working with compound variables'
215 typeset -a stack.items=([0]=foo [1]=bar)
216 [[ ${stack.items[0]} == foo ]] || err_exit 'typeset -a variable not expanding correctly'
218 x=(foo=([1]=(y=([2]=(z=4)))))
222 function foo
228 a=( b=$(foo) )
232 .sh.value=foo
235 [[ ${b.b1} == foo ]] || err_exit '${b.b1} should be foo'
263 X=( foo=1 )
266 unset foo
267 typeset -A foo=([a]=aa;[b]=bb;[c]=cc)
268 [[ ${foo[c]} == cc ]] || err_exit 'associative array assignment with; not working'
269 [[ $({ $SHELL -c 'x=(); typeset -a x.foo; x.foo=bar; print -r -- "$x"' ;} 2> /dev/null) == $'(\n\ttypeset -a foo=bar\n)' ]] || err_exit 'indexed array in compound variable with only element 0 defined fails'
270 unset foo
271 foo=(typeset -a bar)
272 [[ $foo == *'typeset -a bar'* ]] || err_exit 'array attribute -a not preserved in compound variable'
274 typeset -A s=( [foo]=(y=2 z=3) [bar]=(y=4 z=5))
280 unset foo
281 typeset -C foo
282 foo.bar=abc
283 [[ $foo == $'(\n\tbar=abc\n)' ]] || err_exit 'typeset -C not working for foo'
284 typeset -C foo=(bar=def)
285 [[ $foo == $'(\n\tbar=def\n)' ]] || err_exit 'typeset -C not working when initialized'
286 foo=(
292 eval foo2="$foo"
300 "$foo"
305 [[ $bar == "$foo" ]] || err_exit '$foo != $bar'
308 typeset x=( typeset -a foo=( [1][3]=hello [9][2]="world" ) )
309 eval y="(typeset -a foo=$(printf "%B\n" x.foo) )"
310 [[ $x == "$y" ]] || err_exit '$x.foo != $y.foo with %B'
311 eval y="(typeset -a foo=$(printf "%#B\n" x.foo) )"
312 [[ $x == "$y" ]] || err_exit '$x.foo != $y.foo with %#B'
321 x=( float x=0 y=1; z=([foo]=abc [bar]=def))
336 z=(foo=abc)
338 [[ $y == *foo=abc* ]] || err_exit 'z not appended to y'
339 unset y.foo
340 [[ $x == "$y" ]] || err_exit '$x != $y when y.foo deleted'
342 x=( foo=(z=abc d=ghi) bar=abc; typeset -A r=([x]=3 [y]=4))
349 z.foo=( [one]=hello [two]=(x=3 y=4) [three]=hi)
362 typeset -A foo=(
426 typeset -C -A hello=( [foo]=bar)
427 [[ $(typeset -p hello) == 'typeset -C -A hello=([foo]=bar)' ]] || err_exit 'typeset -A -C with intial assignment not working'
429 [[ $($SHELL -c 'foo=(x=3 y=4);function bar { typeset z=4;: $z;};bar;print ${!foo.@}') == 'foo.x foo.y' ]] 2> /dev/null || err_exit '${!foo.@} after function not working'
431 function foo
437 foo 2> /dev/null <<- \EOF || err_exit 'deleting compound variable in function failed'
440 [a]=( foo=bar)
441 [b]=( foo=bar)
442 [c d]=( foo=bar)
443 [e]=( foo=bar)
444 [f]=( foo=bar)
445 [g]=( foo=bar)
446 [h]=( foo=bar)
447 [i]=( foo=bar)
448 [j]=( foo=bar)
455 mica01[4]=( a_string="foo bar" )
460 expected=$'typeset -C -a mica01=([4]=(a_string=\'foo bar\';some_stuff=hello))'
640 foo=(
653 foo[i++]=(x=3 y=4)
654 [[ ${foo[1].x} == 3 ]] || err_exit "\${foo[1].x} should be 3"
655 [[ ${foo[1].y} == 4 ]] || err_exit "\${foo[1].y} should be 4"
671 do c.board[1][$i]=(foo=bar)
678 zz.[foo]=abc
680 exp='typeset -C zz=([2]=def;foo=abc)'
685 exp='typeset -C zz=([2]=def;typeset -i [3]=123;foo=abc)'
690 xx=(foo=bar)