-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Include filename in input parse error message #3146
base: master
Are you sure you want to change the base?
Conversation
456 | ||
EOF | ||
cat > $d/expected_err <<EOF | ||
jq: parse error (at $d/input_error_line2:2): Invalid numeric literal at line 4, column 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 4
here is a bit confusing, i guess that is counting lines from all input files seen so far
jq: ignoring parse error: Truncated value at line 3, column 1 | ||
jq: ignoring parse error (at <stdin>:2): Truncated value at line 2, column 5 | ||
jq: ignoring parse error (at <stdin>:2): Truncated value at line 2, column 25 | ||
jq: ignoring parse error (at <stdin>:2): Truncated value at line 3, column 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it's at <stdin>:2
and line 3
hmm, haven dugg much but i guess it's start of new value vs where it ended somehow?
EOF | ||
printf '1\0362 3\n[0,1\036[4,5]true"ab"{"c":4\036{}{"d":5,"e":6"false\n\036null'|$VALGRIND $Q $JQ -ces --seq '. == [2,3,[4,5],true,"ab",{},null]' > /dev/null 2> $d/out | ||
cmp $d/out $d/expected | ||
|
||
# Note that here jq sees no inputs at all but it still succeeds because | ||
# --seq ignores parse errors | ||
cat > $d/expected <<EOF | ||
jq: ignoring parse error: Unfinished abandoned text at EOF at line 1, column 4 | ||
jq: ignoring parse error (at <stdin>:0): Unfinished abandoned text at EOF at line 1, column 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably be <stdin>:1
Fixes #1553