Files
nucleic-brush/brush-shell/tests/cases/compat/builtins/local.yaml
T

22 lines
392 B
YAML
Raw Normal View History

name: "Builtins: local"
cases:
- name: "Basic local usage"
stdin: |
myfunc() {
local x=10
echo "in myfunc: x==$x"
}
x=5
echo "before call: x==$x"
myfunc
echo "after call: x==$x"
- name: "Local with empty array"
stdin: |
myfunc() {
local x=()
declare -p x
echo "x[0]: ${x[0]}"
}
myfunc