diff options
author | Nicolas Williams <nico@cryptonector.com> | 2017-01-27 10:06:04 -0600 |
---|---|---|
committer | Nicolas Williams <nico@cryptonector.com> | 2017-01-30 14:11:05 -0600 |
commit | 7bdf3a39ade47c0571bda45c639a8fc0f11d0ca6 (patch) | |
tree | dba867b62a0fbda30a9f7265d018c061ba014e29 /tests | |
parent | 396543191cec32f69712b4364d26a0ebaa61b801 (diff) | |
download | jq-7bdf3a39ade47c0571bda45c639a8fc0f11d0ca6.tar.gz |
Add SQL-style operators (#1322)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/jq.test | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/jq.test b/tests/jq.test index 302952d..fa02b6d 100644 --- a/tests/jq.test +++ b/tests/jq.test @@ -1322,3 +1322,32 @@ jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shel (.[{}] = 0)? null +INDEX(range(5)|[., "foo\(.)"]; .[0]) +null +{"0":[0,"foo0"],"1":[1,"foo1"],"2":[2,"foo2"],"3":[3,"foo3"],"4":[4,"foo4"]} + +JOIN({"0":[0,"abc"],"1":[1,"bcd"],"2":[2,"def"],"3":[3,"efg"],"4":[4,"fgh"]}; .[0]|tostring) +[[5,"foo"],[3,"bar"],[1,"foobar"]] +[[[5,"foo"],null],[[3,"bar"],[3,"efg"]],[[1,"foobar"],[1,"bcd"]]] + +range(5;10)|IN(range(10)) +null +true +true +true +true +true + +range(10;12)|IN(range(10)) +null +false +false + +IN(range(10;20); range(10)) +null +false + +IN(range(5;20); range(10)) +null +true + |