summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2019-01-18 22:33:46 -0600
committerNicolas Williams <nico@cryptonector.com>2019-01-18 22:33:46 -0600
commit61cd6dbb3b7f3423d49a1a9beb2b82ad16a34755 (patch)
treed4add40f2a19bb89ded0b62df377b406414d6348 /tests
parent4b4fefa254346524c787b862e35e4fbb70e01e95 (diff)
downloadjq-61cd6dbb3b7f3423d49a1a9beb2b82ad16a34755.tar.gz
`contains` should handle embedded NULs (fix #1732)
Diffstat (limited to 'tests')
-rw-r--r--tests/jq.test5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/jq.test b/tests/jq.test
index 7e2dd43..041ca1e 100644
--- a/tests/jq.test
+++ b/tests/jq.test
@@ -1091,6 +1091,11 @@ null
{}
[true, true, false]
+# containment operator (embedded NULs!)
+[contains("foo"), contains("\u0000b"), contains("\u0000z"), contains("bar"), contains("baz")]
+"foo\u0000bar"
+[true, true, false, true, false]
+
# Try/catch and general `?` operator
[.[]|try if . == 0 then error("foo") elif . == 1 then .a elif . == 2 then empty else . end catch .]
[0,1,2,3]