Add a regression test for negative indices and fix a pick/1 test

This commit is contained in:
itchyny authored and Nico Williams committed 2023-08-16 17:49:44 -05:00
1 parent f85c9fcb78
commit 0733fd3d58
3 files changed
+11 -10

No files matched your search

+5 -4
View File
@@ -1048,10 +1048,11 @@ sections:
- title: "`pick(pathexps)`"
body: |
Emit the projection of the input object or array defined by the specified
sequence of path expressions, such that if p is any one of these specifications,
then `(. | p)` will evaluate to the same value as `(. | pick(pathexps) | p)`.
For arrays, negative indices and .[m:n] specifications should not be used.
Emit the projection of the input object or array defined by the
specified sequence of path expressions, such that if `p` is any
one of these specifications, then `(. | p)` will evaluate to the
same value as `(. | pick(pathexps) | p)`. For arrays, negative
indices and `.[m:n]` specifications should not be used.
examples:
- program: 'pick(.a, .b.c, .x)'