Add test that listed functions are the same as actually defined

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

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

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)