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