summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2017-02-20 19:24:22 -0600
committerNicolas Williams <nico@cryptonector.com>2017-03-26 05:36:23 -0500
commit7935d307f06133287c381110d1bcd4ac39aa9080 (patch)
tree251e35979933564d3c537d8ff0afb4d57460657c /tests
parent38bfec1594b6706be5a7503a9945fc8eb24b914d (diff)
Allow . as {$a:$b} destructuring
Diffstat (limited to 'tests')
-rw-r--r--tests/jq.test4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/jq.test b/tests/jq.test
index 48def7c8..c07d1dc0 100644
--- a/tests/jq.test
+++ b/tests/jq.test
@@ -720,6 +720,10 @@ null
{"a":1, "b":[2,{"d":3}]}
[1,2,3]
+. as {$a, $b:[$c, $d]}| [$a, $b, $c, $d]
+{"a":1, "b":[2,{"d":3}]}
+[1,[2,{"d":3}],2,{"d":3}]
+
# Destructuring with alternation
.[] | . as {$a, b: [$c, {$d}]} ?// [$a, {$b}, $e] ?// $f | [$a, $b, $c, $d, $e, $f]
[{"a":1, "b":[2,{"d":3}]}, [4, {"b":5, "c":6}, 7, 8, 9], "foo"]