Add graph.Search for substr
This commit is contained in:
@@ -20,7 +20,7 @@ func TestIntegration(t *testing.T) {
|
||||
|
||||
os.Args = os.Args[:1]
|
||||
graph := NewGraph()
|
||||
graph.mongo.db = "test-db"
|
||||
graph.mongo.db = "db"
|
||||
ctx, can := context.WithCancel(context.TODO())
|
||||
defer can()
|
||||
clean := func() {
|
||||
@@ -67,6 +67,17 @@ func TestIntegration(t *testing.T) {
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("graph.Search(foo => *)", func(t *testing.T) {
|
||||
some, err := graph.Search(ctx, "col", ones[0].Name[:3])
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Logf("searching for %s (%s)\nsom = %+v", ones[0].Name, ones[0].Name[:3], some)
|
||||
if len(some) < 1 {
|
||||
t.Fatalf("%+v: %+v", len(some), some)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("graph.Update(foo, --bar)", func(t *testing.T) {
|
||||
err := graph.Update(ctx, "col", ones[0].Query(), operator.Set{entity.Connections, map[string]interface{}{}})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user