tests: quote .[] in shtest which can break syntax highlight (#3235)

This commit is contained in:
itchyny authored and GitHub committed 2025-01-26 08:08:31 +09:00
1 parent 562ffec869
commit 31dac287cc
1 file changed
+2 -2
+2 -2
View File
@@ -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