More investigation, shows that the new RepeatUnrollStrategy completely
removes the RepeatStep because of the times 0 logic.

For the global case the leaves behind the GraphStep and the HasStep thus
returning a1.

For the LocalStep case the LocalSteps are now empty (after the
RepeatSteps have been removed) throwing a FastNoSuchElementException and
thus returning no elements.

However I think we first need to understand what the expected semantics
of a before times(0) is.
I have a feeling that my previous passing tests were just getting lucky?

Thanks
Pieter


On 16/07/2016 18:37, pieter-gmail wrote:
> Hi,
>
> I am running the following tests on 3.2.1-SNAPSHOT
>
>     @Test
>     public void testRepeat() {
>         final TinkerGraph g = TinkerGraph.open();
>         Vertex a1 = g.addVertex(T.label, "A", "name", "a1");
>         Vertex b1 = g.addVertex(T.label, "B", "name", "b1");
>         Vertex b2 = g.addVertex(T.label, "B", "name", "b2");
>         Vertex b3 = g.addVertex(T.label, "B", "name", "b3");
>         a1.addEdge("ab", b1);
>         a1.addEdge("ab", b2);
>         a1.addEdge("ab", b3);
>         Vertex c1 = g.addVertex(T.label, "C", "name", "c1");
>         Vertex c2 = g.addVertex(T.label, "C", "name", "c2");
>         Vertex c3 = g.addVertex(T.label, "C", "name", "c3");
>         b1.addEdge("bc", c1);
>         b1.addEdge("bc", c2);
>         b1.addEdge("bc", c3);
>
>         //this passes   
>         List<Vertex> vertices =
> g.traversal().V().hasLabel("A").<Vertex>times(0).repeat(out("ab").out("bc")).toList();
>         assertEquals(1, vertices.size());
>         assertTrue(vertices.contains(a1));
>    
>         //this fails
>         vertices =
> g.traversal().V().hasLabel("A").local(__.<Vertex>times(0).repeat(out("ab").out("bc"))).toList();
>         assertEquals(1, vertices.size());
>         assertTrue(vertices.contains(a1));
>     }
>
> Previously on 3.2.0-incubating the test passed.
>
> Is this a bug or a new interpretation of the while do zero times logic?
>
> Thanks
> Pieter
>
>
>

Reply via email to