Add test that unmarking for export prevents inheritence by child shell

This commit is contained in:
Eric Levy 2022-01-25 17:00:09 -05:00
parent 747bb59322
commit 88e7f09227
2 changed files with 17 additions and 0 deletions

View File

@ -6,3 +6,4 @@ subshell-export
function-list
function-unload
function-export
function-unexport

16
meta-tests/function-unexport.sh Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
list_function_names() {
declare -F | while read l; do echo ${l/#* /}; done | sort
}
declare -xf list_function_names
f_orig=$(list_function_names)
source ./mo
moExport
moUnexport
f=$(bash -c list_function_names)
diff <(echo $f_orig | tr ' ' '\n') <(echo $f | tr ' ' '\n')