Add a few more test cases (from the man page)
Signed-off-by: Nicolas Williams <nico@cryptonector.com>
This commit is contained in:
1 parent
6a401c8262
commit
a0b942a7f5
1 file changed
+24
@@ -633,3 +633,27 @@ unique
|
||||
[{a:1}] | .[] | .a=999
|
||||
null
|
||||
{"a": 999}
|
||||
|
||||
to_entries
|
||||
{"a": 1, "b": 2}
|
||||
[{"key":"a", "value":1}, {"key":"b", "value":2}]
|
||||
|
||||
from_entries
|
||||
[{"key":"a", "value":1}, {"key":"b", "value":2}]
|
||||
{"a": 1, "b": 2}
|
||||
|
||||
with_entries(.key |= "KEY_" + .)
|
||||
{"a": 1, "b": 2}
|
||||
{"KEY_a": 1, "KEY_b": 2}
|
||||
|
||||
map(has("foo"))
|
||||
[{"foo": 42}, {}]
|
||||
[true, false]
|
||||
|
||||
map(has(2))
|
||||
[[0,1], ["a","b","c"]]
|
||||
[false, true]
|
||||
|
||||
keys
|
||||
[42,3,35]
|
||||
[0,1,2]
|
||||
Reference in new issue
Block a user