Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve reliability of NO_COLOR tests. #3188

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tests/shtest
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ JQ="$JQ -b"

PATH=$JQBASEDIR:$PATH $JQBASEDIR/tests/jq-f-test.sh > /dev/null

SHELL=/bin/sh
export SHELL

if [ -f "$JQBASEDIR/.libs/libinject_errors.so" ]; then
# Do some simple error injection tests to check that we're handling
# I/O errors correctly.
Expand Down Expand Up @@ -586,17 +589,17 @@ if $test_no_color && command -v script >/dev/null 2>&1; then
od -tc $d/expect
od -tc $d/color
cmp $d/color $d/expect
NO_COLOR= faketty $JQ_NO_B -n . > $d/color
faketty env NO_COLOR= $JQ_NO_B -n . > $d/color
printf '\033[0;90mnull\033[0m\r\n' > $d/expect
od -tc $d/expect
od -tc $d/color
cmp $d/color $d/expect
NO_COLOR=1 faketty $JQ_NO_B -n . > $d/color
faketty env NO_COLOR=1 $JQ_NO_B -n . > $d/color
printf 'null\r\n' > $d/expect
od -tc $d/expect
od -tc $d/color
cmp $d/color $d/expect
NO_COLOR=1 faketty $JQ_NO_B -Cn . > $d/color
faketty env NO_COLOR=1 $JQ_NO_B -Cn . > $d/color
printf '\033[0;90mnull\033[0m\r\n' > $d/expect
od -tc $d/expect
od -tc $d/color
Expand Down
Loading