This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/master by this push:
new 9fc704f Model for developing specific Gremlin semantics tests CTR
9fc704f is described below
commit 9fc704fe0219dbdfd3386dff8d8c64630b28da94
Author: Stephen Mallette <[email protected]>
AuthorDate: Thu Nov 4 15:40:31 2021 -0400
Model for developing specific Gremlin semantics tests CTR
---
docs/src/dev/developer/for-committers.asciidoc | 7 +++--
docs/src/dev/provider/gremlin-semantics.asciidoc | 19 +++++++++----
gremlin-test/features/semantics/Equality.feature | 36 ++++++++++++++++++++++++
3 files changed, 54 insertions(+), 8 deletions(-)
diff --git a/docs/src/dev/developer/for-committers.asciidoc
b/docs/src/dev/developer/for-committers.asciidoc
index 4860b0e..33465ee 100644
--- a/docs/src/dev/developer/for-committers.asciidoc
+++ b/docs/src/dev/developer/for-committers.asciidoc
@@ -480,9 +480,10 @@ Scenario: g_V_outE_drop
Features have tags associated with them to help allow developers to better
break up test runs if they desire. There
are two types of tags:
-* `@StepClass*` - Marks the step grouping and is a prefix that precedes and
either refers to one of the four types of
-steps: `Branch`, `Filter`, `Map`, and `SideEffect` (e.g. `@StepClassBranch`)
or to an `Integrated` grouping that does
-not fit those individual classifications well.
+* `@StepClass*` - Marks the step grouping and is a prefix that precedes and
either refers to one of the following:
+** One of the four types of steps: `Branch`, `Filter`, `Map`, and `SideEffect`
(e.g. `@StepClassBranch`)
+** `Semantics` which maps to elements of the
link:https://tinkerpop.apache.org/docs/x.y.z/dev/provider/#gremlin-semantics[Gremlin
Semantics] specification.
+** An `Integrated` grouping that does not fit those individual classifications
well.
* `@Step*` - Marks testing for a particular step. While this tag is generally
unique to the feature
file itself and test filtering could be accomplished at that level by way of
the file, the use of the tag is a
secondary option and allows filtering to be consistently managed by tags
alone. The suffix is the Gremlin step itself
diff --git a/docs/src/dev/provider/gremlin-semantics.asciidoc
b/docs/src/dev/provider/gremlin-semantics.asciidoc
index b31cf14..a6af906 100644
--- a/docs/src/dev/provider/gremlin-semantics.asciidoc
+++ b/docs/src/dev/provider/gremlin-semantics.asciidoc
@@ -19,7 +19,11 @@ limitations under the License.
This section provides details on Gremlin language operational semantics.
Describing these semantics and reinforcing
them with tests in the Gremlin test suite makes it easier for providers to
implement the language and for the
-TinkerPop Community to have better consistency in their user experiences.
+TinkerPop Community to have better consistency in their user experiences.
While the general Gremlin test suite offers
+an integrated approach to testing Gremlin queries, the `@StepClassSemantics`
oriented tests found
+link:https://github.com/apache/tinkerpop/tree/x.y.z/gremlin-test/features[here]
are especially focused to the
+definitions found in this section. References to the location of specific
tests can be found throughout the
+sub-sections below.
== Types
@@ -71,8 +75,8 @@ In addition to these, there are composite types as follows:
* Edge
* VertexProperty
* Property
- ** Edge property
- ** Vertex meta property
+** Edge property
+** Vertex meta property
* PropertyKey
* PropertyValue
* Label
@@ -92,8 +96,8 @@ Double, BigInteger, and BigDecimal. Here is the rule how
types are promoted:
* If at least one is BigInteger then compare as BigInteger
* If at least one is Double then compare as Double
* If one of them is a Float, then convert both to floating type of highest
common bit denomination
- ** If another value is Long or Double, we need 64bit so convert both to
Double
- ** Otherwise convert both to Float
+** If another value is Long or Double, we need 64bit so convert both to Double
+** Otherwise convert both to Float
* If at least one is Long then compare as Long
* If at least one is Integer then compare as Integer
* If at least one is Short then compare as Short
@@ -115,6 +119,7 @@ Both equality and equivalence can be understood as
complete, i.e. the result of
always either `true` or `false` (in particular, it never returns nulltype` or
throws an exception). The details on
equality and equivalence are sketched in the following two subsections,
respectively.
+[[gremlin-semantics-equality]]
=== Equality
* Used by equality and membership predicates (such as `P.eq, `P.neq`, and the
list membership `P.within`) in Gremlin.
@@ -136,6 +141,8 @@ numerical type if they cast into the exactly same same
value of the lowest commo
* Equality checks always return `true` or `false`. They never result in
`nulltype` output, undefined behavior, nor do
they ever throw an error.
+See:
link:https://github.com/apache/tinkerpop/tree/x.y.z/gremlin-test/features/Equality.feature[Equality
Tests]
+
==== Primitive types
===== Number
@@ -155,6 +162,8 @@ Number consists of Byte, Short, Integer, Long, Float,
Double, BigInteger, and Bi
* TinkerPop is JVM based so there can be ±INF^^float and ±INF^^double,
NaN^^float and NaN^^double. They also adhere to
the type promotion rules.
+See:
link:https://github.com/apache/tinkerpop/tree/x.y.z/gremlin-test/features/Equality.feature[Equality
Tests - Scenarios prefixed with "Primitives - Number"]
+
===== Boolean
* If either one of LHS or RHS is Boolean and another isn't, return `false`
diff --git a/gremlin-test/features/semantics/Equality.feature
b/gremlin-test/features/semantics/Equality.feature
new file mode 100644
index 0000000..a7960a0
--- /dev/null
+++ b/gremlin-test/features/semantics/Equality.feature
@@ -0,0 +1,36 @@
+# 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.
+
+@StepClassSemantics
+Feature: Equality
+
+ # TODO: TINKERPOP-2524 to support all the number types (and others required
for semantics checks)
+ Scenario: Primitives - Number - eq(int)
+ Given the modern graph
+ And using the parameter xx1 defined as
"l[d[1].i,d[1].l,d[1].f,d[1].d,d[1000].i]"
+ And using the parameter xx2 defined as "d[1].i"
+ And the traversal of
+ """
+ g.inject(xx1).unfold().where(__.is(P.eq(xx2)))
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[1].i |
+ | d[1].l |
+ | d[1].f |
+ | d[1].d |
\ No newline at end of file