Rename triple entities were relevant

This commit is contained in:
kortschak 2014-08-27 21:27:01 +09:30
parent ddf8849e60
commit 443a091b72
62 changed files with 664 additions and 664 deletions

View file

@ -21,23 +21,23 @@ import (
)
func TestLinksTo(t *testing.T) {
ts := &store{
qs := &store{
data: []string{1: "cool"},
iter: newFixed(),
}
ts.iter.(*Fixed).Add(2)
qs.iter.(*Fixed).Add(2)
fixed := newFixed()
val := ts.ValueOf("cool")
val := qs.ValueOf("cool")
if val != 1 {
t.Fatalf("Failed to return correct value, got:%v expect:1", val)
}
fixed.Add(val)
lto := NewLinksTo(ts, fixed, quad.Object)
lto := NewLinksTo(qs, fixed, quad.Object)
if !lto.Next() {
t.Error("At least one triple matches the fixed object")
t.Error("At least one quad matches the fixed object")
}
val = lto.Result()
if val != 2 {
t.Errorf("Quad index 2, such as %s, should match %s", ts.Quad(2), ts.Quad(val))
t.Errorf("Quad index 2, such as %s, should match %s", qs.Quad(2), qs.Quad(val))
}
}