fix gremlin test, add reversal test

This commit is contained in:
Barak Michener 2015-10-30 17:42:16 -04:00
parent 283aca83c2
commit 58a735f329
2 changed files with 8 additions and 3 deletions

View file

@ -239,6 +239,11 @@ func testSet(qs graph.QuadStore) []test {
path: StartPath(qs, "greg").LabelContext("smart_graph").Out("status"), path: StartPath(qs, "greg").LabelContext("smart_graph").Out("status"),
expect: []string{"smart_person"}, expect: []string{"smart_person"},
}, },
{
message: "reverse context",
path: StartPath(qs, "greg").Tag("base").LabelContext("smart_graph").Out("status").Tag("status").Back("base"),
expect: []string{"greg"},
},
} }
} }

View file

@ -217,7 +217,7 @@ var testQueries = []struct {
g.V().Save("status", "somecool").All() g.V().Save("status", "somecool").All()
`, `,
tag: "somecool", tag: "somecool",
expect: []string{"cool_person", "cool_person", "cool_person"}, expect: []string{"cool_person", "cool_person", "cool_person", "smart_person", "smart_person"},
}, },
{ {
message: "show a simple saveR", message: "show a simple saveR",
@ -289,8 +289,8 @@ var testQueries = []struct {
func runQueryGetTag(g []quad.Quad, query string, tag string) []string { func runQueryGetTag(g []quad.Quad, query string, tag string) []string {
js := makeTestSession(g) js := makeTestSession(g)
c := make(chan interface{}, 5) c := make(chan interface{}, 1)
js.Execute(query, c, -1) go js.Execute(query, c, -1)
var results []string var results []string
for res := range c { for res := range c {