summaryrefslogtreecommitdiffstats
path: root/tests/shtest
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2015-09-21 23:24:08 -0500
committerDavid Tolnay <dtolnay@gmail.com>2015-09-22 20:11:54 -0700
commitc4524da3e092adcb4d0af5636ae2309d08418a9e (patch)
tree3825f57a04ff222d840a0a5ba17de0a1aec14a4c /tests/shtest
parent58f082d74fa29ead024ff2d695eae874b9b67538 (diff)
EOF after newline in string mishandled (fix #951)
Diffstat (limited to 'tests/shtest')
-rwxr-xr-xtests/shtest13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/shtest b/tests/shtest
index 6e7690e4..1a956130 100755
--- a/tests/shtest
+++ b/tests/shtest
@@ -109,10 +109,21 @@ printf '1' | $JQ -ce --seq . > $d/out 2>&1
cmp $d/out $d/expected
cat > $d/expected <<EOF
+jq: error (at <stdin>:1): Unfinished abandoned text at EOF at line 2, column 0
EOF
-printf '1\n' | $JQ -cen --seq '[inputs] == []' >/dev/null 2> $d/out
+if printf '1\n' | $JQ -cen --seq '[inputs] == []' >/dev/null 2> $d/out; then
+ printf 'Error expected but jq exited successfully\n' 1>&2
+ exit 2
+fi
cmp $d/out $d/expected
+# Regression test for #951
+printf '"a\n' > $d/input
+if $VALGRIND $Q $JQ -e . $d/input; then
+ printf 'Issue #951 is back?\n' 1>&2
+ exit 2
+fi
+
## Test streaming parser
## If we add an option to stream to the `import ... as $symbol;` directive