(t *testing.T)
| 257 | } |
| 258 | |
| 259 | func TestAtomHash(t *testing.T) { |
| 260 | a := NewAtom("bar", String("foo")) |
| 261 | h := fnv.New64() |
| 262 | h.Write([]byte(a.Predicate.Symbol)) |
| 263 | b := make([]byte, 8) |
| 264 | binary.LittleEndian.PutUint64(b, a.Args[0].(Constant).Hash()) |
| 265 | h.Write(b) |
| 266 | expected := h.Sum64() |
| 267 | if a.Hash() != expected { |
| 268 | t.Errorf("(%v).Hash() expected %v got %v", a, expected, a.Hash()) |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | func TestString(t *testing.T) { |
| 273 | tests := []struct { |