diff --git a/meta-tests.txt b/meta-tests.txt index e8a55f4..64e86b5 100644 --- a/meta-tests.txt +++ b/meta-tests.txt @@ -4,3 +4,4 @@ subshell-undeclared subshell-source subshell-export function-list +function-unload diff --git a/meta-tests/function-unload.sh b/meta-tests/function-unload.sh new file mode 100755 index 0000000..263c8d7 --- /dev/null +++ b/meta-tests/function-unload.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +list_function_names() { + declare -F | while read l; do echo ${l/#* /}; done | sort +} + +f_orig=$(list_function_names) + +source ./mo +moUnload + +f=$(list_function_names) + +diff <(echo $f_orig | tr ' ' '\n') <(echo $f | tr ' ' '\n')