1package datastore_test 2 3import ( 4 "io/ioutil" 5 "log" 6 "testing" 7 8 dstore "github.com/ipfs/go-datastore" 9 dstest "github.com/ipfs/go-datastore/test" 10) 11 12func TestMapDatastore(t *testing.T) { 13 ds := dstore.NewMapDatastore() 14 dstest.SubtestAll(t, ds) 15} 16 17func TestNullDatastore(t *testing.T) { 18 ds := dstore.NewNullDatastore() 19 // The only test that passes. Nothing should be found. 20 dstest.SubtestNotFounds(t, ds) 21} 22 23func TestLogDatastore(t *testing.T) { 24 defer log.SetOutput(log.Writer()) 25 log.SetOutput(ioutil.Discard) 26 ds := dstore.NewLogDatastore(dstore.NewMapDatastore(), "") 27 dstest.SubtestAll(t, ds) 28} 29