Add Save/SaveReverse and HAS API and split path.go into two files

This commit is contained in:
Barak Michener 2015-06-02 15:27:12 -04:00
parent 34de880945
commit f825fef208
3 changed files with 316 additions and 165 deletions

View file

@ -160,6 +160,28 @@ func testSet(qs graph.QuadStore) []test {
path: StartPath(qs, "A", "B", "C").Except(StartPath(qs, "B")).Except(StartPath(qs, "A")),
expect: []string{"C"},
},
{
message: "show a simple save",
path: StartPath(qs).Save("status", "somecool"),
tag: "somecool",
expect: []string{"cool", "cool", "cool"},
},
{
message: "show a simple saveR",
path: StartPath(qs, "cool").SaveReverse("status", "who"),
tag: "who",
expect: []string{"G", "D", "B"},
},
{
message: "show a simple Has",
path: StartPath(qs).Has("status", "cool"),
expect: []string{"G", "D", "B"},
},
{
message: "show a double Has",
path: StartPath(qs).Has("status", "cool").Has("follows", "F"),
expect: []string{"B"},
},
}
}