mirror of
https://github.com/tests-always-included/mo.git
synced 2024-12-19 00:37:51 +00:00
Add test that defined functions are properly unloaded
This commit is contained in:
parent
61d6b0c6ef
commit
9a81e1d831
@ -4,3 +4,4 @@ subshell-undeclared
|
||||
subshell-source
|
||||
subshell-export
|
||||
function-list
|
||||
function-unload
|
||||
|
14
meta-tests/function-unload.sh
Executable file
14
meta-tests/function-unload.sh
Executable 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')
|
Loading…
Reference in New Issue
Block a user