fix: unset environment variables before shtests (#3283)

Tests no longer fail if `JQ_COLORS` and `NO_COLOR` are already set.
This commit is contained in:
SArpnt authored and GitHub committed 2025-03-05 07:59:46 +09:00
1 parent a09a4dfd55
commit 9d6efec198
1 file changed
+3 -2
+3 -2
View File
@@ -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