Skip to content
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

Testing jq-go #2

Open
suntong opened this issue Dec 31, 2016 · 0 comments
Open

Testing jq-go #2

suntong opened this issue Dec 31, 2016 · 0 comments

Comments

@suntong
Copy link

suntong commented Dec 31, 2016

The API interface, at least in all test files, looks really strange to me, as I'm expecting JSON string as input (and the outputs are normally JSON string as well). However, all test cases covered are just using a series of integers as input, which is quite unusual.

Would it be possible that you extend the test coverage to normal JSON strings as well? For e.g., you can use the following operation, input and output. Thanks.

.foo
{"foo": 42, "bar": 43}
42

.foo | .bar
{"foo": {"bar": 42}, "bar": "badvalue"}
42

.foo.bar
{"foo": {"bar": 42}, "bar": "badvalue"}
42

.foo_bar
{"foo_bar": 2}
2

.["foo"].bar
{"foo": {"bar": 42}, "bar": "badvalue"}
42

."foo"."bar"
{"foo": {"bar": 20}}
20

[.[]|.foo?]
[1,[2],{"foo":3,"bar":4},{},{"foo":5}]
[3,null,5]

[.[]|.foo?.bar?]
[1,[2],[],{"foo":3},{"foo":{"bar":4}},{}]
[4,null]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant