diff options
author | itchyny <itchyny@cybozu.co.jp> | 2023-07-23 11:47:20 +0900 |
---|---|---|
committer | Nico Williams <nico@cryptonector.com> | 2023-07-23 17:06:00 -0500 |
commit | 98f709d0c1fd87a8b6a3e10c679442667712b264 (patch) | |
tree | b68ab1896ec53669e898700342e229610b3dfe56 /tests | |
parent | dfdce8c6e793961823c1591030861a2f73b177f1 (diff) |
Fix stderr to output string with no decoration (fix #2063)
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/shtest | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/shtest b/tests/shtest index 1ee84d3a..6cc428ca 100755 --- a/tests/shtest +++ b/tests/shtest @@ -237,6 +237,16 @@ grep "Expected string key after '{', not '\\['" $d/err > /dev/null echo '{"x":"y",["a","b"]}' | $JQ --stream > /dev/null 2> $d/err || true grep "Expected string key after ',' in object, not '\\['" $d/err > /dev/null +# debug, stderr +$VALGRIND $Q $JQ -n '"test", {} | debug, stderr' >/dev/null +$JQ -n -c -j '"hello\nworld", null, [false, 0], {"foo":["bar"]}, "\n" | stderr' >$d/out 2>$d/err +cat > $d/expected <<'EOF' +hello +worldnull[false,0]{"foo":["bar"]} +EOF +cmp $d/out $d/expected +cmp $d/err $d/expected + # --arg, --argjson, $ARGS.named $VALGRIND $JQ -n -c --arg foo 1 --argjson bar 2 '{$foo, $bar} | ., . == $ARGS.named' > $d/out printf '{"foo":"1","bar":2}\ntrue\n' > $d/expected |