diff options
author | pkoppstein <pkoppstein@gmail.com> | 2023-07-31 18:54:21 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-01 07:54:21 +0900 |
commit | 4d4c17ca6a9e11fc49e98f5d8fa0ac4da34fb298 (patch) | |
tree | 7c7c3831cb45b26329bba1a9e569627ba74dc961 /tests/jq.test | |
parent | 0f80921268edcc3d502e6d84612ba71fed6b0947 (diff) |
Simple and efficient implementation of walk/1 (#2795)
Diffstat (limited to 'tests/jq.test')
-rw-r--r-- | tests/jq.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/jq.test b/tests/jq.test index 73cf93d0..c460f5d3 100644 --- a/tests/jq.test +++ b/tests/jq.test @@ -1975,3 +1975,22 @@ implode|explode map(try implode catch .) [123,["a"],[nan]] ["implode input must be an array","string (\"a\") can't be imploded, unicode codepoint needs to be numeric","number (null) can't be imploded, unicode codepoint needs to be numeric"] + +# walk +walk(.) +{"x":0} +{"x":0} + +walk(1) +{"x":0} +1 + +# The following is a regression test, not a requirement: +[walk(.,1)] +{"x":0} +[{"x":0},1] + +# Issue #2584 +walk(select(IN({}, []) | not)) +{"a":1,"b":[]} +{"a":1} |