fix building Or iterator, add test
This commit is contained in:
parent
0b91414c4b
commit
539bd9b272
2 changed files with 8 additions and 1 deletions
|
|
@ -128,7 +128,7 @@ func buildPathFromObject(obj *otto.Object) *path.Path {
|
||||||
if subobj == nil {
|
if subobj == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return p.And(buildPathFromObject(subobj))
|
return p.Or(buildPathFromObject(subobj))
|
||||||
case "Back":
|
case "Back":
|
||||||
if len(stringArgs) != 1 {
|
if len(stringArgs) != 1 {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,13 @@ var testQueries = []struct {
|
||||||
`,
|
`,
|
||||||
expect: []string{"charlie"},
|
expect: []string{"charlie"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
message: "test Or()",
|
||||||
|
query: `
|
||||||
|
g.V("bob").Out("follows").Or(g.V().Has("status", "cool_person")).All()
|
||||||
|
`,
|
||||||
|
expect: []string{"fred", "bob", "greg", "dani"},
|
||||||
|
},
|
||||||
|
|
||||||
// Gremlin Has tests.
|
// Gremlin Has tests.
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue