Skip to content

Commit

Permalink
Add true case tests for checkAdjacentVertices configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ryn5 committed Feb 21, 2024
1 parent d804e4a commit 3e31860
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
2 changes: 2 additions & 0 deletions gremlin-go/driver/cucumber/gremlin.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[
"g_withStrategiesXSubgraphStrategyXedges_hasLabelXusesX_hasXskill_5XXX_V_outE_valueMap_selectXvaluesX_unfold": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices: true, Edges: gremlingo.T__.HasLabel("uses").Has("skill", 5)})).V().OutE().ValueMap().Select(gremlingo.Column.Values).Unfold()}},
"g_withStrategiesXSubgraphStrategyXsubgraphDXX_V": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices: false, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within([]interface{}{"josh", "lop", "ripple"})), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight", 0.4).HasLabel("created"), gremlingo.T__.Has("weight", 1.0).HasLabel("created"))})).V()}},
"g_withStrategiesXSubgraphStrategyXsubgraphDXX_E": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices: false, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within([]interface{}{"josh", "lop", "ripple"})), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight", 0.4).HasLabel("created"), gremlingo.T__.Has("weight", 1.0).HasLabel("created"))})).E()}},
"g_withStrategiesXSubgraphStrategyXcheckAdjacentVertices_subgraphDXX_E": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices: true, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within([]interface{}{"josh", "lop", "ripple"})), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight", 0.4).HasLabel("created"), gremlingo.T__.Has("weight", 1.0).HasLabel("created"))})).E()}},
"g_withStrategiesXSubgraphStrategyXsubgraphDXX_VX4X_outE": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices: false, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within([]interface{}{"josh", "lop", "ripple"})), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight", 0.4).HasLabel("created"), gremlingo.T__.Has("weight", 1.0).HasLabel("created"))})).V(p["vid4"]).OutE()}},
"g_withStrategiesXSubgraphStrategyXsubgraphDXX_VX4X_inE": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices: false, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within([]interface{}{"josh", "lop", "ripple"})), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight", 0.4).HasLabel("created"), gremlingo.T__.Has("weight", 1.0).HasLabel("created"))})).V(p["vid4"]).InE()}},
"g_withStrategiesXSubgraphStrategyXsubgraphDXX_VX4X_out": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices: false, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within([]interface{}{"josh", "lop", "ripple"})), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight", 0.4).HasLabel("created"), gremlingo.T__.Has("weight", 1.0).HasLabel("created"))})).V(p["vid4"]).Out()}},
Expand All @@ -459,6 +460,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[
"g_withStrategiesXSubgraphStrategyXsubgraphDXX_EX11X_bothV": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices: false, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within([]interface{}{"josh", "lop", "ripple"})), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight", 0.4).HasLabel("created"), gremlingo.T__.Has("weight", 1.0).HasLabel("created"))})).E(p["eid11"]).BothV()}},
"g_withStrategiesXSubgraphStrategyXsubgraphDXX_EX12X_bothV": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices: false, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within([]interface{}{"josh", "lop", "ripple"})), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight", 0.4).HasLabel("created"), gremlingo.T__.Has("weight", 1.0).HasLabel("created"))})).E(p["eid12"]).BothV()}},
"g_withStrategiesXSubgraphStrategyXsubgraphDXX_EX9X_bothV": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices: false, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within([]interface{}{"josh", "lop", "ripple"})), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight", 0.4).HasLabel("created"), gremlingo.T__.Has("weight", 1.0).HasLabel("created"))})).E(p["eid9"]).BothV()}},
"g_withStrategiesXSubgraphStrategyXcheckAdjacentVertices_subgraphDXX_EX9X_bothV": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.SubgraphStrategy(gremlingo.SubgraphStrategyConfig{CheckAdjacentVertices: true, Vertices: gremlingo.T__.Has("name", gremlingo.P.Within([]interface{}{"josh", "lop", "ripple"})), Edges: gremlingo.T__.Or(gremlingo.T__.Has("weight", 0.4).HasLabel("created"), gremlingo.T__.Has("weight", 1.0).HasLabel("created"))})).E(p["eid9"]).BothV()}},
"g_VX1X_asXaX_outXcreatedX_addEXcreatedByX_toXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).As("a").Out("created").AddE("createdBy").To("a")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).InE()}},
"g_VX1X_asXaX_outXcreatedX_addEXcreatedByX_toXaX_propertyXweight_2X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).As("a").Out("created").AddE("createdBy").To("a").Property("weight", 2.0)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).InE().Has("weight", 2.0)}},
"g_V_outE_propertyXweight_nullX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().OutE().Property("weight", nil)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E().Properties("weight")}},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3e31860

Please sign in to comment.