Skip to content

Commit

Permalink
tests: quote .[] in shtest which can break syntax highlight (#3235)
Browse files Browse the repository at this point in the history
  • Loading branch information
itchyny authored Jan 25, 2025
1 parent 562ffec commit 31dac28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/shtest
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ cmp $d/out $d/expected

# Regression test for --raw-output0
printf "a\0b\0" > $d/expected
printf '["a", "b"]' | $VALGRIND $Q $JQ --raw-output0 .[] > $d/out
printf '["a", "b"]' | $VALGRIND $Q $JQ --raw-output0 '.[]' > $d/out
cmp $d/out $d/expected
printf "a\0" > $d/expected
if printf '["a", "c\\u0000d", "b"]' | $VALGRIND $Q $JQ --raw-output0 .[] > $d/out; then
if printf '["a", "c\\u0000d", "b"]' | $VALGRIND $Q $JQ --raw-output0 '.[]' > $d/out; then
echo "Should exit error on string containing NUL with --raw-output0" 1>&2
exit 1
elif [ $? -ne 5 ]; then
Expand Down

0 comments on commit 31dac28

Please sign in to comment.