Skip to content

Commit

Permalink
Add additional feature tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryn5 committed Oct 17, 2023
1 parent d14e5ba commit 02b865b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,9 @@ private static IDictionary<string, List<Func<GraphTraversalSource, IDictionary<s
{"g_V_hasLabelXsoftwareX_valueXnameX_substringX1_4X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("software").Values<object>("name").Substring(1,4)}},
{"g_V_hasLabelXsoftwareX_valueXnameX_substringX1_0X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("software").Values<object>("name").Substring(1,0)}},
{"g_V_hasLabelXpersonX_valueXnameX_substringXneg3X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("person").Values<object>("name").Substring(-3)}},
{"g_V_hasLabelXsoftwareX_valueXnameX_substringX1_neg1X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("software").Values<object>("name").Substring(1,-1)}},
{"g_V_hasLabelXsoftwareX_valueXnameX_substringXneg4_2X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("software").Values<object>("name").Substring(-4,2)}},
{"g_V_hasLabelXsoftwareX_valueXnameX_substringXneg3_neg1X", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().HasLabel("software").Values<object>("name").Substring(-3,-1)}},
{"g_V_age_sum", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Values<object>("age").Sum<object>()}},
{"g_V_foo_sum", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Values<object>("foo").Sum<object>()}},
{"g_V_age_fold_sumXlocalX", new List<Func<GraphTraversalSource, IDictionary<string, object>, ITraversal>> {(g,p) =>g.V().Values<object>("age").Fold().Sum<object>(Scope.Local)}},
Expand Down
3 changes: 3 additions & 0 deletions gremlin-go/driver/cucumber/gremlin.go
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,9 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[
"g_V_hasLabelXsoftwareX_valueXnameX_substringX1_4X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("software").Values("name").Substring(1, 4)}},
"g_V_hasLabelXsoftwareX_valueXnameX_substringX1_0X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("software").Values("name").Substring(1, 0)}},
"g_V_hasLabelXpersonX_valueXnameX_substringXneg3X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Values("name").Substring(-3)}},
"g_V_hasLabelXsoftwareX_valueXnameX_substringX1_neg1X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("software").Values("name").Substring(1, -1)}},
"g_V_hasLabelXsoftwareX_valueXnameX_substringXneg4_2X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("software").Values("name").Substring(-4, 2)}},
"g_V_hasLabelXsoftwareX_valueXnameX_substringXneg3_neg1X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("software").Values("name").Substring(-3, -1)}},
"g_V_age_sum": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("age").Sum()}},
"g_V_foo_sum": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("foo").Sum()}},
"g_V_age_fold_sumXlocalX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("age").Fold().Sum(gremlingo.Scope.Local)}},
Expand Down

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

3 changes: 3 additions & 0 deletions gremlin-python/src/main/python/radish/gremlin.py
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,9 @@
'g_V_hasLabelXsoftwareX_valueXnameX_substringX1_4X': [(lambda g:g.V().hasLabel('software').name.substring(1,4))],
'g_V_hasLabelXsoftwareX_valueXnameX_substringX1_0X': [(lambda g:g.V().hasLabel('software').name.substring(1,0))],
'g_V_hasLabelXpersonX_valueXnameX_substringXneg3X': [(lambda g:g.V().hasLabel('person').name.substring(-3))],
'g_V_hasLabelXsoftwareX_valueXnameX_substringX1_neg1X': [(lambda g:g.V().hasLabel('software').name.substring(1,-1))],
'g_V_hasLabelXsoftwareX_valueXnameX_substringXneg4_2X': [(lambda g:g.V().hasLabel('software').name.substring(-4,2))],
'g_V_hasLabelXsoftwareX_valueXnameX_substringXneg3_neg1X': [(lambda g:g.V().hasLabel('software').name.substring(-3,-1))],
'g_V_age_sum': [(lambda g:g.V().age.sum_())],
'g_V_foo_sum': [(lambda g:g.V().foo.sum_())],
'g_V_age_fold_sumXlocalX': [(lambda g:g.V().age.fold().sum_(Scope.local))],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,39 @@ Feature: Step - substring()
| osh |
| das |
| ter |

Scenario: g_V_hasLabelXsoftwareX_valueXnameX_substringX1_neg1X
Given the modern graph
And the traversal of
"""
g.V().hasLabel("software").values("name").substring(1, -1)
"""
When iterated to list
Then the result should be unordered
| result |
| o |
| ippl |

Scenario: g_V_hasLabelXsoftwareX_valueXnameX_substringXneg4_2X
Given the modern graph
And the traversal of
"""
g.V().hasLabel("software").values("name").substring(-4, 2)
"""
When iterated to list
Then the result should be unordered
| result |
| lo |
| str[] |

Scenario: g_V_hasLabelXsoftwareX_valueXnameX_substringXneg3_neg1X
Given the modern graph
And the traversal of
"""
g.V().hasLabel("software").values("name").substring(-3, -1)
"""
When iterated to list
Then the result should be unordered
| result |
| lo |
| pl |

0 comments on commit 02b865b

Please sign in to comment.