From 9d6efec1987b544ac2f8030e3c22036f7cb70cd9 Mon Sep 17 00:00:00 2001 From: SArpnt Date: Tue, 4 Mar 2025 22:59:46 +0000 Subject: [PATCH] fix: unset environment variables before shtests (#3283) Tests no longer fail if `JQ_COLORS` and `NO_COLOR` are already set. --- tests/shtest | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/shtest b/tests/shtest index 72ffc086..3cfe5f45 100755 --- a/tests/shtest +++ b/tests/shtest @@ -17,6 +17,9 @@ PATH=$JQBASEDIR:$PATH $JQBASEDIR/tests/jq-f-test.sh > /dev/null SHELL=/bin/sh export SHELL +unset JQ_COLORS +unset NO_COLOR + if [ -f "$JQBASEDIR/.libs/libinject_errors.so" ]; then # Do some simple error injection tests to check that we're handling # I/O errors correctly. @@ -419,7 +422,6 @@ if [ "$($VALGRIND $Q $JQ -n '{"a":"xyz"} | halt_error(1)' 2>&1)" != '{"a":"xyz"} fi # Check $JQ_COLORS -unset JQ_COLORS ## Default colors, null input $JQ -Ccn . > $d/color @@ -558,7 +560,6 @@ test_no_color=true $msys && test_no_color=false $mingw && test_no_color=false if $test_no_color && command -v script >/dev/null 2>&1; then - unset NO_COLOR if script -qc echo /dev/null >/dev/null 2>&1; then faketty() { script -qec "$*" /dev/null; } else # macOS