Skip to content

Instantly share code, notes, and snippets.

@crosbymichael
Last active December 23, 2015 21:09
Show Gist options
  • Save crosbymichael/6694416 to your computer and use it in GitHub Desktop.
Save crosbymichael/6694416 to your computer and use it in GitHub Desktop.
package graphdb
import (
"testing"
)
type relationship string
func (p relationship) String() string {
return string(p)
}
func TestNewDatabase(t *testing.T) {
db := NewDatabase()
parent, err := db.CreateNode("5555")
if err != nil {
t.Fatal(err)
}
child, err := db.CreateNode("6666")
if err != nil {
t.Fatal(err)
}
if err := child.CreateRelationship(parent, relationship("parent")); err != nil {
t.Fatal(err)
}
for r := range parent.Traverse() {
t.Log(r.Direction, r.Type)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment