From 507eb8283c45bc9241020f14febabe0ada6c5ec6 Mon Sep 17 00:00:00 2001 From: Emanuele Torre Date: Mon, 11 Dec 2023 20:45:14 +0100 Subject: shtest: fix out-of-source tests The locale test was using ./jq intead of $JQ. I also removed the use of obsolete egrep instead of grep -E that triggers warnings on GNU systems, and the use of deprecated head -1 instead of head -n1. Also removed the unnecessary hiding of strptime/1 errors with ? // false. --- tests/shtest | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/shtest b/tests/shtest index dd007d15..6ecadaa9 100755 --- a/tests/shtest +++ b/tests/shtest @@ -566,15 +566,18 @@ if ! $VALGRIND $Q $JQ -n -f "$JQTESTDIR/yes-main-program.jq" > $d/out 2>&1; then exit 1 fi -if ( ! $msys && ! $mingw ) && locale -a > /dev/null; then - locale=$(locale -a | egrep -v '^(C|LANG|POSIX|en)' | egrep -i 'utf8|utf-8' | head -1) - if [ -z "$locale" ]; then +if ! $msys && ! $mingw && locales=$(locale -a); then + { l=$(grep -Ev '^(C|LANG|POSIX|en)' | grep -Ei '\.utf-?8$' | head -n1) ;} \ +<