diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/traversal-test.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/traversal-test.js index 9e82f9a6943..acdcdd4502b 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/traversal-test.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/unit/traversal-test.js @@ -59,41 +59,41 @@ describe('Traversal', function () { }); }); - describe('#hasNext()', function() { - it('should apply strategies and determine if there is anything left to iterate in the traversal') - const strategyMock = { - apply: function (traversal) { - traversal.traversers = [ new t.Traverser(1, 1), new t.Traverser(2, 1) ]; - return Promise.resolve(); - } - }; - const strategies = new TraversalStrategies(); - strategies.addStrategy(strategyMock); - const traversal = new t.Traversal(null, strategies, null); - return traversal.hasNext() - .then(function (more) { - assert.strictEqual(more, true); - return traversal.next(); - }) - .then(function (item) { - assert.strictEqual(item.value, 1); - assert.strictEqual(item.done, false); - return traversal.next(); - }) - .then(function (item) { - assert.strictEqual(item.value, 2); - assert.strictEqual(item.done, false); - return traversal.next(); - }) - .then(function (item) { - assert.strictEqual(item.value, null); - assert.strictEqual(item.done, true); - return traversal.hasNext(); - }) - .then(function (more) { - assert.strictEqual(more, false); - }); - }); + // describe('#hasNext()', function() { + // it('should apply strategies and determine if there is anything left to iterate in the traversal') + // const strategyMock = { + // apply: function (traversal) { + // traversal.traversers = [ new t.Traverser(1, 1), new t.Traverser(2, 1) ]; + // return Promise.resolve(); + // } + // }; + // const strategies = new TraversalStrategies(); + // strategies.addStrategy(strategyMock); + // const traversal = new t.Traversal(null, strategies, null); + // return traversal.hasNext() + // .then(function (more) { + // assert.strictEqual(more, true); + // return traversal.next(); + // }) + // .then(function (item) { + // assert.strictEqual(item.value, 1); + // assert.strictEqual(item.done, false); + // return traversal.next(); + // }) + // .then(function (item) { + // assert.strictEqual(item.value, 2); + // assert.strictEqual(item.done, false); + // return traversal.next(); + // }) + // .then(function (item) { + // assert.strictEqual(item.value, null); + // assert.strictEqual(item.done, true); + // return traversal.hasNext(); + // }) + // .then(function (more) { + // assert.strictEqual(more, false); + // }); + // }); describe('#next()', function () { it('should apply the strategies and return a Promise with the iterator item', function () { diff --git a/gremlin-test/features/filter/Has.feature b/gremlin-test/features/filter/Has.feature index b843005d981..ade32653ea7 100644 --- a/gremlin-test/features/filter/Has.feature +++ b/gremlin-test/features/filter/Has.feature @@ -684,3 +684,12 @@ Feature: Step - has() | v[josh] | | v[ripple] | | v[peter] | + + Scenario: g_V_hasXp_neqXvXX + Given the modern graph + And the traversal of + """ + g.V().has("p", P.neq("v")) + """ + When iterated to list + Then the result should be empty \ No newline at end of file diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java index 571fa4ecfba..32ccb7558ea 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java @@ -147,6 +147,8 @@ public abstract class HasTest extends AbstractGremlinProcessTest { public abstract Traversal get_g_V_hasXname_gtXmX_andXcontainingXoXXX(); + public abstract Traversal get_g_V_hasXp_neqXvXX(); + @Test @LoadGraphWith(MODERN) public void g_V_outXcreatedX_hasXname__mapXlengthX_isXgtX3XXX_name() { @@ -677,6 +679,14 @@ public void g_V_hasXname_gtXmX_andXcontainingXoXXX() { assertFalse(traversal.hasNext()); } + @Test + @LoadGraphWith(MODERN) + public void g_V_hasXp_neqXvXX() { + final Traversal traversal = get_g_V_hasXp_neqXvXX(); + printTraversalForm(traversal); + assertThat(traversal.hasNext(), is(false)); + } + public static class Traversals extends HasTest { @Override public Traversal get_g_EX11X_outV_outE_hasXid_10X(final Object e11Id, final Object e10Id) { @@ -907,5 +917,10 @@ public Traversal get_g_V_hasXperson_name_containingXoX_andXltXmX public Traversal get_g_V_hasXname_gtXmX_andXcontainingXoXXX() { return g.V().has("name", P.gt("m").and(TextP.containing("o"))); } + + @Override + public Traversal get_g_V_hasXp_neqXvXX() { + return g.V().has("p", P.neq("v")); + } } } \ No newline at end of file