1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package rendezvous import ( "hash/fnv" "testing" ) func hashString(s string) uint64 { h := fnv.New64a() h.Write([]byte(s)) return h.Sum64() } func TestEmpty(t *testing.T) { r := New([]string{}, hashString) r.Lookup("hello") }