Upstream itchyny/gojq state of the touched files before f68bda411a
This commit is contained in:
1 parent
a7ed5ccbe9
commit
b18851b748
3 files changed
+35
-128
No files matched your search
+2
-83
@@ -2407,29 +2407,6 @@
|
||||
"/a,b/c/d/e,f/"
|
||||
",/ /a/,/b/,/ /c/,/ /d/,/ /e/,/f/,/ "
|
||||
|
||||
- name: split/1 function against empty string
|
||||
args:
|
||||
- -c
|
||||
- '.[] as $t | .[] as $s | $s | split($t)'
|
||||
input: '["abc", "a", "b", ""]'
|
||||
expected: |
|
||||
["",""]
|
||||
["a"]
|
||||
["b"]
|
||||
[]
|
||||
["","bc"]
|
||||
["",""]
|
||||
["b"]
|
||||
[]
|
||||
["a","c"]
|
||||
["a"]
|
||||
["",""]
|
||||
[]
|
||||
["a","b","c"]
|
||||
["a"]
|
||||
["b"]
|
||||
[]
|
||||
|
||||
- name: join function
|
||||
args:
|
||||
- 'join(",")'
|
||||
@@ -3608,16 +3585,6 @@
|
||||
expected: |
|
||||
8
|
||||
|
||||
- name: reduce with assignment of multiple paths in update
|
||||
args:
|
||||
- -c
|
||||
- 'reduce (1,2) as $i (.; (.[0], .[.[0]]) = $i),
|
||||
reduce (1,2) as $i (.; (.[0], .[.[0]]) |= $i)'
|
||||
input: '[0,0,0]'
|
||||
expected: |
|
||||
[2,2,0]
|
||||
[2,2,0]
|
||||
|
||||
- name: reduce with query in start
|
||||
args:
|
||||
- 'reduce range(5) as $x (range(3); . + $x)'
|
||||
@@ -5022,46 +4989,6 @@
|
||||
expected: |
|
||||
{"a":[{},{"b":[1,2,3]}]}
|
||||
|
||||
- name: getpath function against string
|
||||
args:
|
||||
- -c
|
||||
- '[getpath([{"start":1,"end":3}]), getpath([{"start":-2,"end":null}]), getpath([1]), getpath([])]'
|
||||
input: '"abcde"'
|
||||
expected: |
|
||||
["bc","de","b","abcde"]
|
||||
|
||||
- name: getpath function against string in a container
|
||||
args:
|
||||
- -c
|
||||
- 'getpath(["a",{"start":0,"end":2}]), getpath(["a",1])'
|
||||
input: '{"a":"abc"}'
|
||||
expected: |
|
||||
"ab"
|
||||
"b"
|
||||
|
||||
- name: getpath function against string round trip with path function
|
||||
args:
|
||||
- -c
|
||||
- '[getpath(path(.[1:3])), getpath(path(.[1]))]'
|
||||
input: '"abcde"'
|
||||
expected: |
|
||||
["bc","b"]
|
||||
|
||||
- name: getpath function against string round trip in a container
|
||||
args:
|
||||
- -c
|
||||
- '. as $d | [path(.a[0:2]), path(.b[1])] | map(. as $p | $d | getpath($p))'
|
||||
input: '{"a":"abc","b":"xyz"}'
|
||||
expected: |
|
||||
["ab","y"]
|
||||
|
||||
- name: getpath function against string with object key
|
||||
args:
|
||||
- 'getpath(["k"])'
|
||||
input: '"abc"'
|
||||
error: |
|
||||
getpath(["k"]) cannot be applied to "abc": expected an object but got: string ("abc")
|
||||
|
||||
- name: getpath function error
|
||||
args:
|
||||
- 'getpath(["a",1,"b","c"])'
|
||||
@@ -5094,9 +5021,9 @@
|
||||
expected: |
|
||||
{"a":[{"b":5}]}
|
||||
{"a":[{"b":5}],"b":0}
|
||||
"getpath([\"a\",0,\"b\"]) cannot be applied to {\"a\":0}: expected an array but got: number (0)"
|
||||
"getpath([\"a\",0,\"b\"]) cannot be applied to: object ({\"a\":0})"
|
||||
{"a":[{"b":5}]}
|
||||
"getpath([\"a\",0,\"b\"]) cannot be applied to {\"a\":[0,1]}: expected an object but got: number (0)"
|
||||
"getpath([\"a\",0,\"b\"]) cannot be applied to: object ({\"a\":[0,1]})"
|
||||
"getpath([\"a\",0,\"b\"]) cannot be applied to {\"a\":{\"b\":1}}: expected an array but got: object ({\"b\":1})"
|
||||
{"a":[{"b":5}]}
|
||||
{"a":[{"b":5,"c":3}]}
|
||||
@@ -5502,14 +5429,6 @@
|
||||
expected: |
|
||||
[1,3,6,5,5]
|
||||
|
||||
- name: update-assignment operator against object with overlapping paths
|
||||
args:
|
||||
- -c
|
||||
- '(.a.b,.a,.a.p.z) |= {p: ., q: .}'
|
||||
input: '{"a":{"b":1}}'
|
||||
expected: |
|
||||
{"a":{"p":{"b":{"p":1,"q":1},"z":{"p":null,"q":null}},"q":{"b":{"p":1,"q":1}}}}
|
||||
|
||||
- name: update-assignment operator with optional operator
|
||||
args:
|
||||
- -c
|
||||
|
||||
Reference in new issue
Block a user