summaryrefslogtreecommitdiffstats
path: root/testdata
diff options
context:
space:
mode:
authorStephen Roantree <stroantree@gmail.com>2012-10-24 11:42:25 -0700
committerStephen Roantree <stroantree@gmail.com>2012-10-24 13:50:26 -0700
commit5e25c2a259d2337d38b730d5dc22e7db67ea88cb (patch)
treebf0d88fdad29f2fa9ea25a3ae5de73c8ea7c2297 /testdata
parent033d9b2fd55b1fef0f17ce91d864c55e07f3ee5d (diff)
Implemented contains operator
Diffstat (limited to 'testdata')
-rw-r--r--testdata25
1 files changed, 25 insertions, 0 deletions
diff --git a/testdata b/testdata
index 8cd5e27c..ce330112 100644
--- a/testdata
+++ b/testdata
@@ -395,3 +395,28 @@ def inc(x): x |= .+1; inc(.[].a)
[{"foo":[1,2,{"bar":18},"world"]} == {"foo":[1,2,{"bar":18},"world"]},{"foo":[1,2,{"bar":18},"world"]} == {"foo":[1,2,{"bar":19},"world"]}]
{}
[true,false]
+
+# containment operator
+["foo" contains "foo", "foobar" contains "foo", "foo" contains "foobar"]
+{}
+[true, true, false]
+
+[[] contains [], [1,2,3] contains [1,2], [1,2,3] contains [3,1], [1,2,3] contains [4], [1,2,3] contains [1,4]]
+{}
+[true, true, true, false, false]
+
+[["foobar", "foobaz"] contains ["baz", "bar"], ["foobar", "foobaz"] contains ["foo"], ["foobar", "foobaz"] contains ["blap"]]
+{}
+[true, true, false]
+
+[{foo: 12, bar:13} contains {foo: 12}, {foo: 12} contains {}, {foo: 12, bar:13} contains {baz:14}]
+{}
+[true, true, false]
+
+{foo: {baz: 12, blap: {bar: 13}}, bar: 14} contains {bar: 14, foo: {blap: {}}}
+{}
+true
+
+{foo: {baz: 12, blap: {bar: 13}}, bar: 14} contains {bar: 14, foo: {blap: {bar: 14}}}
+{}
+false \ No newline at end of file