no test driver non driver things
parent
a674022357
commit
9848492b1e
|
|
@ -15,56 +15,4 @@ func TestDriver(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
defer d.Close()
|
defer d.Close()
|
||||||
|
|
||||||
/*
|
|
||||||
if b, err := d.Get(ctx, "m", "id"); err != nil {
|
|
||||||
t.Error("cannot get from empty:", err)
|
|
||||||
} else if b != nil {
|
|
||||||
t.Error("got fake from empty")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := d.ForEach(ctx, "m", func(string, []byte) error {
|
|
||||||
return errors.New("should have no hits")
|
|
||||||
}); err != nil {
|
|
||||||
t.Error("failed to forEach empty:", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := d.Set(ctx, "m", "id", []byte(`"hello world"`)); err != nil {
|
|
||||||
t.Error("cannot set from empty:", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if b, err := d.Get(ctx, "m", "id"); err != nil {
|
|
||||||
t.Error("cannot get from full:", err)
|
|
||||||
} else if string(b) != `"hello world"` {
|
|
||||||
t.Error("got fake from full")
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := d.ForEach(ctx, "m", func(id string, v []byte) error {
|
|
||||||
if id != "id" {
|
|
||||||
t.Error("for each id weird:", id)
|
|
||||||
}
|
|
||||||
if string(v) != `"hello world"` {
|
|
||||||
t.Error("for each value weird:", string(v))
|
|
||||||
}
|
|
||||||
return io.EOF
|
|
||||||
}); err != io.EOF {
|
|
||||||
t.Error("failed to forEach full:", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := d.Set(ctx, "m", "id", nil); err != nil {
|
|
||||||
t.Error("cannot set from full:", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := d.ForEach(ctx, "m", func(string, []byte) error {
|
|
||||||
return errors.New("should have no hits")
|
|
||||||
}); err != nil {
|
|
||||||
t.Error("failed to forEach empty:", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if b, err := d.Get(ctx, "m", "id"); err != nil {
|
|
||||||
t.Error("cannot get from deleted:", err)
|
|
||||||
} else if b != nil {
|
|
||||||
t.Error("got fake from deleted")
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue