Class TernaryBooleanLogicsTest
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.AbstractGremlinTest
-
- org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest
-
- org.apache.tinkerpop.gremlin.process.traversal.step.TernaryBooleanLogicsTest
-
public class TernaryBooleanLogicsTest extends AbstractGremlinProcessTest
- Author:
- Mike Personick (http://github.com/mikepersonick)
-
-
Field Summary
-
Fields inherited from class org.apache.tinkerpop.gremlin.AbstractGremlinTest
config, g, graph, graphProvider, name, shouldTestIteratorLeak
-
-
Constructor Summary
Constructors Constructor Description TernaryBooleanLogicsTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
testAnd()
Over a ternary binary semantics, the AND predicate evaluates to TRUE only if both arguments are TRUE.void
testCompareAcrossTypes()
Comparisons across type families.void
testCompareNaN()
NaN comparisons always produce UNDEF comparison, reducing to FALSE in ternary->binary reduction.void
testCompareNull()
Null comparisons.void
testNot()
The NOT predicate inverts TRUE and FALSE but maintains ERROR values.void
testOr()
Being symetrically defined to AND, OR only returns FALSE in the case that both arguments evalute to FALSE.void
testXor()
Ternary XOR semantics.-
Methods inherited from class org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest
checkHasNext, checkMap, checkOrderedResults, checkResults, checkResults, checkSideEffects, graphMeetsTestRequirements, hasGraphComputerRequirement, makeMapList, setupTest
-
Methods inherited from class org.apache.tinkerpop.gremlin.AbstractGremlinTest
afterLoadGraphWith, assertVertexEdgeCounts, beforeLoadGraphWith, convertToEdge, convertToEdge, convertToEdgeId, convertToEdgeId, convertToVertex, convertToVertex, convertToVertexId, convertToVertexId, convertToVertexProperty, convertToVertexProperty, convertToVertexPropertyId, convertToVertexPropertyId, getAssertVertexEdgeCounts, printTraversalForm, setup, tearDown, tryCommit, tryCommit, tryRollback, validateException, verifyRootIdentification, verifyUniqueStepIds
-
-
-
-
Method Detail
-
testCompareNaN
public void testCompareNaN()
NaN comparisons always produce UNDEF comparison, reducing to FALSE in ternary->binary reduction.
-
testCompareNull
public void testCompareNull()
Null comparisons. Null is considered to be a distinct type, thus will produce ERROR for comparison against non-null, just like any cross-type comparison. Null is == null and is != to any non-null (except for NaN, which is always UNDEF/ERROR).
-
testCompareAcrossTypes
public void testCompareAcrossTypes()
Comparisons across type families. FALSE for P.eq, TRUE for P.neq, and UNDEF with binary reduction to FALSE for P.lt/lte/gt/gte.
-
testAnd
public void testAnd()
Over a ternary binary semantics, the AND predicate evaluates to TRUE only if both arguments are TRUE. AND will propogate ERROR values unless the other argument evalutes to FALSE, since FALSE && X => FALSE.
-
testOr
public void testOr()
Being symetrically defined to AND, OR only returns FALSE in the case that both arguments evalute to FALSE. In cases where one argument is FALSE and the other ERROR, OR propogates the ERROR. Whenever one argument is TRUE, OR returns TRUE since TRUE || X => TRUE.
-
testNot
public void testNot()
The NOT predicate inverts TRUE and FALSE but maintains ERROR values. For ERROR, we can neither prove nor disprove the value expression and hence stick with ERROR.
-
testXor
public void testXor()
Ternary XOR semantics.
-
-