ledisdb/store/goleveldb_test.go

33 lines
420 B
Go
Raw Normal View History

2014-07-28 05:25:40 +04:00
package store
import (
"github.com/siddontang/ledisdb/config"
2014-07-28 05:25:40 +04:00
"os"
2014-07-28 05:25:40 +04:00
"testing"
)
func newTestGoLevelDB() *DB {
cfg := new(config.Config)
cfg.DBName = "goleveldb"
cfg.DataDir = "/tmp/testdb"
2014-07-28 05:25:40 +04:00
os.RemoveAll(getStorePath(cfg))
2014-07-28 05:25:40 +04:00
db, err := Open(cfg)
if err != nil {
println(err.Error())
panic(err)
}
return db
}
func TestGoLevelDB(t *testing.T) {
db := newTestGoLevelDB()
testStore(db, t)
db.Close()
}