Add test that defined functions are properly unloaded

This commit is contained in:
Eric Levy 2022-01-24 19:32:50 -05:00
parent 61d6b0c6ef
commit 9a81e1d831
2 changed files with 15 additions and 0 deletions

View File

@ -4,3 +4,4 @@ subshell-undeclared
subshell-source
subshell-export
function-list
function-unload

14
meta-tests/function-unload.sh Executable file
View File

@ -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')