From 0f92d6382369105c0d1497bfc45728762c76a9aa Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Fri, 12 Feb 2021 12:45:47 +0000 Subject: [PATCH] tests/attributes.sh: fix spurious fail if any env var contains 'foo' --- src/cmd/ksh93/tests/attributes.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/ksh93/tests/attributes.sh b/src/cmd/ksh93/tests/attributes.sh index 5e92634b8..30903eed2 100755 --- a/src/cmd/ksh93/tests/attributes.sh +++ b/src/cmd/ksh93/tests/attributes.sh @@ -248,8 +248,8 @@ function fun [[ $foo == hello ]] || err_exit 'export scoping problem in function' } fun -[[ $(export | grep foo) == 'foo=hello' ]] || err_exit 'export not working in functions' -[[ $(export | grep bar) ]] && err_exit 'typeset -x not local' +[[ $'\n'$(export)$'\n' == *$'\nfoo=hello\n'* ]] || err_exit 'export not working in functions' +[[ $'\n'$(export) == *$'\nbar='* ]] && err_exit 'typeset -x not local' [[ $($SHELL -c 'typeset -r IFS=;print -r $(pwd)' 2> /dev/null) == "$(pwd)" ]] || err_exit 'readonly IFS causes command substitution to fail' fred[66]=88 [[ $(typeset -pa) == *fred* ]] || err_exit 'typeset -pa not working'