-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Describe the bug
There are several different test case syntaxes which do not follow single logick.
Current behavior
As for now you can look into jq.test and find syntaxes:
- Header describing file syntax - program + input + output. But this is totally wrong!
- %%FAIL - assert error with specified message (no program/output are provided).
- %%FAIL IGNORE MSG - assert error with any message.
- # Runtime error - comment that must be ignored but actually asserts fail.
- No output at all - actually this must be
[]
but somehow just no line generates successful pass for test. - Multiline output - this is only one logical hack, but still is hack.
- BOM at line start - well, whole file is already parsed to memory so wtf?
- JSON unparsable values - mostly type overflow and incorrect values (likely from JSON5). This is very strange for json tool to have unsupported json values...
{x: -1}
→null
→{"x": -1}
- just wrong output. Can you see one extra space? This is false positive test.
Expected behavior
Each test case must be normalized to well-documented format. To my mind it should be JSON format with schema. Example:
true
null
true
should be converted to
{
"filter": "true",
"inputs": [null],
"outputs": [true]
}
Notice that this is JSON but raw cli string.