packagecoreimport("testing"config"github.com/jbenet/go-ipfs/config")funcTestDatastores(t*testing.T){good:=[]*config.Config{&config.Config{Datastore:&config.Datastore{Type:"memory"}},&config.Config{Datastore:&config.Datastore{Type:"leveldb",Path:".testdb"}},}bad:=[]*config.Config{&config.Config{Datastore:&config.Datastore{}},&config.Config{Datastore:&config.Datastore{Type:"badtype"}},&config.Config{},nil,}fori,c:=range(good){n,err:=NewIpfsNode(c)ifn==nil||err!=nil{t.Error("Should have constructed.",i,err)}}fori,c:=range(bad){n,err:=NewIpfsNode(c)ifn!=nil||err==nil{t.Error("Should have failed to construct.",i)}}}