You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2017/11/21 20:53:48 UTC

[14/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for match()

TINKERPOP-1784 Added feature tests for match()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/3b542678
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/3b542678
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/3b542678

Branch: refs/heads/TINKERPOP-1784
Commit: 3b54267846bc86a927cf44839c1333e2ba63135a
Parents: 8f0b8f7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Nov 9 12:50:52 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Tue Nov 21 15:52:52 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Match.feature | 80 ++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3b542678/gremlin-test/features/map/Match.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Match.feature b/gremlin-test/features/map/Match.feature
new file mode 100644
index 0000000..59c56fd
--- /dev/null
+++ b/gremlin-test/features/map/Match.feature
@@ -0,0 +1,80 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+Feature: Step - match()
+
+  Scenario: g_V_valueMap_matchXa_selectXnameX_bX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().valueMap().match(__.as("a").select("name").as("b"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"a":{"name":["marko"],"age":[29]},"b":["marko"]}] |
+      | m[{"a":{"name":["vadas"],"age":[27]},"b":["vadas"]}] |
+      | m[{"a":{"name":["lop"],"lang":["java"]},"b":["lop"]}] |
+      | m[{"a":{"name":["josh"],"age":[32]},"b":["josh"]}] |
+      | m[{"a":{"name":["ripple"],"lang":["java"]},"b":["ripple"]}] |
+      | m[{"a":{"name":["peter"],"age":[35]},"b":["peter"]}] |
+
+  Scenario: g_V_matchXa_out_bX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().match(__.as("a").out().as("b"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"a":"v[marko]","b":"v[lop]"}] |
+      | m[{"a":"v[marko]","b":"v[vadas]"}] |
+      | m[{"a":"v[marko]","b":"v[josh]"}] |
+      | m[{"a":"v[josh]","b":"v[ripple]"}] |
+      | m[{"a":"v[josh]","b":"v[lop]"}] |
+      | m[{"a":"v[peter]","b":"v[lop]"}] |
+
+  Scenario: g_V_matchXa_out_bX_selectXb_idX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().match(__.as("a").out().as("b")).select("b").by(T.id)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[3] |
+      | d[2] |
+      | d[4] |
+      | d[5] |
+      | d[3] |
+      | d[3] |
+
+  Scenario: g_V_matchXa_knows_b__b_created_cX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().match(__.as("a").out("knows").as("b"),
+                  __.as("b").out("created").as("c"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"a":"v[marko]","b":"v[josh]", "c":"v[ripple]"}] |
+      | m[{"a":"v[marko]","b":"v[josh]", "c":"v[lop]"}] |
+