mirror of
https://github.com/tests-always-included/mo.git
synced 2025-04-11 10:39:53 +00:00
Add test that listed functions are the same as actually defined
This commit is contained in:
parent
cec3502e22
commit
61d6b0c6ef
@ -3,3 +3,4 @@ subshell-simple
|
||||
subshell-undeclared
|
||||
subshell-source
|
||||
subshell-export
|
||||
function-list
|
||||
|
15
meta-tests/function-list.sh
Executable file
15
meta-tests/function-list.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
list_function_names() {
|
||||
declare -F | while read l; do echo ${l/#* /}; done | sort
|
||||
}
|
||||
|
||||
f_orig=$(list_function_names)
|
||||
|
||||
source ./mo
|
||||
|
||||
f=$(list_function_names)
|
||||
|
||||
f_new=$(comm -13 <(echo $f_orig | tr ' ' '\n') <(echo $f | tr ' ' '\n'))
|
||||
|
||||
diff <(echo $f_new | tr ' ' '\n') <(moListFuncs | sort)
|
Loading…
x
Reference in New Issue
Block a user