From 4cd6b4822ca8f35fe5b1ea4691301636e2ea7d0a Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 9 Feb 2020 06:41:52 -1000 Subject: [PATCH] [Tests] try to make `nvm unload` test more robust --- ...\"nvm unload\" should unset all function and variables." | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git "a/test/fast/Running \"nvm unload\" should unset all function and variables." "b/test/fast/Running \"nvm unload\" should unset all function and variables." index cd5ec6c..516c4f0 100755 --- "a/test/fast/Running \"nvm unload\" should unset all function and variables." +++ "b/test/fast/Running \"nvm unload\" should unset all function and variables." @@ -5,11 +5,11 @@ set -ex BEFORE="./before.tmp" AFTER="./after.tmp" -cleanup () { rm -f "${BEFORE}" "${AFTER}"; } +cleanup () { echo rm -f "${BEFORE}" "${AFTER}"; } die () { echo "$@" ; cleanup ; exit 1; } typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${BEFORE}" -env | grep -v PATH= | grep -v NVM_ >> "${BEFORE}" +env | grep -v PATH= | grep -v IFS= | grep -v NVM_ | sort >> "${BEFORE}" set +e # TODO: fix \. ../../nvm.sh @@ -20,7 +20,7 @@ type nvm > /dev/null 2>&1 || die "nvm not loaded" nvm unload typeset -f | awk '/ \(\) $/ && !/^main / {print $1}' > "${AFTER}" -env | grep -v PATH= >> "${AFTER}" +env | grep -v PATH= | grep -v IFS= | sort >> "${AFTER}" ! type nvm > /dev/null 2>&1 || die "nvm not unloaded"