diff --git a/meta-tests.txt b/meta-tests.txt index 4107891..4792085 100644 --- a/meta-tests.txt +++ b/meta-tests.txt @@ -6,3 +6,4 @@ subshell-export function-list function-unload function-export +function-unexport diff --git a/meta-tests/function-unexport.sh b/meta-tests/function-unexport.sh new file mode 100755 index 0000000..5190c49 --- /dev/null +++ b/meta-tests/function-unexport.sh @@ -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')